(function(Le,Re){typeof exports=="object"&&typeof module<"u"?Re(exports):typeof define=="function"&&define.amd?define(["exports"],Re):(Le=typeof globalThis<"u"?globalThis:Le||self,Re(Le.Tinyflow={}))})(this,function(Le){"use strict";var Jm=Object.defineProperty;var vd=Le=>{throw TypeError(Le)};var Qm=(Le,Re,Ke)=>Re in Le?Jm(Le,Re,{enumerable:!0,configurable:!0,writable:!0,value:Ke}):Le[Re]=Ke;var gt=(Le,Re,Ke)=>Qm(Le,typeof Re!="symbol"?Re+"":Re,Ke),ll=(Le,Re,Ke)=>Re.has(Le)||vd("Cannot "+Ke);var Ue=(Le,Re,Ke)=>(ll(Le,Re,"read from private field"),Ke?Ke.call(Le):Re.get(Le)),Kn=(Le,Re,Ke)=>Re.has(Le)?vd("Cannot add the same private member more than once"):Re instanceof WeakSet?Re.add(Le):Re.set(Le,Ke),mo=(Le,Re,Ke,po)=>(ll(Le,Re,"write to private field"),po?po.call(Le,Ke):Re.set(Le,Ke),Ke),yd=(Le,Re,Ke)=>(ll(Le,Re,"access private method"),Ke);var Nn,Sr,fo,Oi,md,dn,Tt;const Re="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Re);let Ke=!1;function po(){Ke=!0}po();const Di=1,Li=2,al=4,pd=8,wd=16,_d=1,bd=2,cl=4,xd=8,Cd=16,ul=1,kd=2,dl="[",Ii="[!",Hi="]",Fn={},vt=Symbol();function Ed(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const Sd=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Pd(e){return Sd.includes(e)}const Md={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject"};function Nd(e){return e=e.toLowerCase(),Md[e]??e}const Od=["touchstart","touchmove"];function Td(e){return Od.includes(e)}const fl=!1;var Pr=Array.isArray,$i=Array.from,wo=Object.keys,_o=Object.defineProperty,nn=Object.getOwnPropertyDescriptor,hl=Object.getOwnPropertyDescriptors,Ad=Object.prototype,zd=Array.prototype,Ri=Object.getPrototypeOf;function Mr(e){return typeof e=="function"}const Mt=()=>{};function Dd(e){return e()}function Nr(e){for(var t=0;t<e.length;t++)e[t]()}const zt=2,gl=4,Or=8,Vi=16,Dt=32,Zn=64,Yi=128,Tn=256,bo=512,ct=1024,hn=2048,qn=4096,Xt=8192,Gn=16384,Ld=32768,Tr=65536,Id=1<<17,Hd=1<<19,vl=1<<20,gn=Symbol("$state"),Bi=Symbol("legacy props"),$d=Symbol("");function yl(e){return e===this.v}function Xi(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Wi(e){return!Xi(e,this.v)}function Rd(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Vd(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Yd(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Bd(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Xd(){throw new Error("https://svelte.dev/e/hydration_failed")}function Wd(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Kd(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Fd(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Zd(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function qd(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function yt(e,t){var n={f:0,v:e,reactions:null,equals:yl,version:0};return n}function ml(e){return pl(yt(e))}function Ar(e,t=!1){var r;const n=yt(e);return t||(n.equals=Wi),Ke&&Te!==null&&Te.l!==null&&((r=Te.l).s??(r.s=[])).push(n),n}function j(e,t=!1){return pl(Ar(e,t))}function pl(e){return Ve!==null&&Ve.f&zt&&(Ft===null?sf([e]):Ft.push(e)),e}function X(e,t){return Ve!==null&&ts()&&Ve.f&(zt|Vi)&&(Ft===null||!Ft.includes(e))&&qd(),Ki(e,t)}function Ki(e,t){return e.equals(t)||(e.v=t,e.version=Vl(),wl(e,hn),ts()&&ke!==null&&ke.f&ct&&!(ke.f&Dt)&&(lt!==null&&lt.includes(e)?(It(ke,hn),Oo(ke)):_n===null?lf([e]):_n.push(e))),t}function wl(e,t){var n=e.reactions;if(n!==null)for(var r=ts(),o=n.length,i=0;i<o;i++){var s=n[i],l=s.f;l&hn||!r&&s===ke||(It(s,t),l&(ct|Tn)&&(l&zt?wl(s,qn):Oo(s)))}}function xo(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let xe=!1;function rn(e){xe=e}let Me;function bt(e){if(e===null)throw xo(),Fn;return Me=e}function vn(){return bt(Wt(Me))}function ae(e){if(xe){if(Wt(Me)!==null)throw xo(),Fn;Me=e}}function zr(e=1){if(xe){for(var t=e,n=Me;t--;)n=Wt(n);Me=n}}function Fi(){for(var e=0,t=Me;;){if(t.nodeType===8){var n=t.data;if(n===Hi){if(e===0)return t;e-=1}else(n===dl||n===Ii)&&(e+=1)}var r=Wt(t);t.remove(),t=r}}function yn(e,t=null,n){if(typeof e!="object"||e===null||gn in e)return e;const r=Ri(e);if(r!==Ad&&r!==zd)return e;var o=new Map,i=Pr(e),s=yt(0);i&&o.set("length",yt(e.length));var l;return new Proxy(e,{defineProperty(u,a,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&Kd();var d=o.get(a);return d===void 0?(d=yt(c.value),o.set(a,d)):X(d,yn(c.value,l)),!0},deleteProperty(u,a){var c=o.get(a);if(c===void 0)a in u&&o.set(a,yt(vt));else{if(i&&typeof a=="string"){var d=o.get("length"),f=Number(a);Number.isInteger(f)&&f<d.v&&X(d,f)}X(c,vt),_l(s)}return!0},get(u,a,c){var y;if(a===gn)return e;var d=o.get(a),f=a in u;if(d===void 0&&(!f||(y=nn(u,a))!=null&&y.writable)&&(d=yt(yn(f?u[a]:vt,l)),o.set(a,d)),d!==void 0){var h=g(d);return h===vt?void 0:h}return Reflect.get(u,a,c)},getOwnPropertyDescriptor(u,a){var c=Reflect.getOwnPropertyDescriptor(u,a);if(c&&"value"in c){var d=o.get(a);d&&(c.value=g(d))}else if(c===void 0){var f=o.get(a),h=f==null?void 0:f.v;if(f!==void 0&&h!==vt)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return c},has(u,a){var h;if(a===gn)return!0;var c=o.get(a),d=c!==void 0&&c.v!==vt||Reflect.has(u,a);if(c!==void 0||ke!==null&&(!d||(h=nn(u,a))!=null&&h.writable)){c===void 0&&(c=yt(d?yn(u[a],l):vt),o.set(a,c));var f=g(c);if(f===vt)return!1}return d},set(u,a,c,d){var E;var f=o.get(a),h=a in u;if(i&&a==="length")for(var y=c;y<f.v;y+=1){var _=o.get(y+"");_!==void 0?X(_,vt):y in u&&(_=yt(vt),o.set(y+"",_))}f===void 0?(!h||(E=nn(u,a))!=null&&E.writable)&&(f=yt(void 0),X(f,yn(c,l)),o.set(a,f)):(h=f.v!==vt,X(f,yn(c,l)));var C=Reflect.getOwnPropertyDescriptor(u,a);if(C!=null&&C.set&&C.set.call(d,c),!h){if(i&&typeof a=="string"){var w=o.get("length"),v=Number(a);Number.isInteger(v)&&v>=w.v&&X(w,v+1)}_l(s)}return!0},ownKeys(u){g(s);var a=Reflect.ownKeys(u).filter(f=>{var h=o.get(f);return h===void 0||h.v!==vt});for(var[c,d]of o)d.v!==vt&&!(c in u)&&a.push(c);return a},setPrototypeOf(){Fd()}})}function _l(e,t=1){X(e,e.v+t)}var mt,bl,xl;function Zi(){if(mt===void 0){mt=window;var e=Element.prototype,t=Node.prototype;bl=nn(t,"firstChild").get,xl=nn(t,"nextSibling").get,e.__click=void 0,e.__className="",e.__attributes=null,e.__styles=null,e.__e=void 0,Text.prototype.__t=void 0}}function mn(e=""){return document.createTextNode(e)}function pt(e){return bl.call(e)}function Wt(e){return xl.call(e)}function ge(e,t){if(!xe)return pt(e);var n=pt(Me);if(n===null)n=Me.appendChild(mn());else if(t&&n.nodeType!==3){var r=mn();return n==null||n.before(r),bt(r),r}return bt(n),n}function $e(e,t){if(!xe){var n=pt(e);return n instanceof Comment&&n.data===""?Wt(n):n}return Me}function ye(e,t=1,n=!1){let r=xe?Me:e;for(var o;t--;)o=r,r=Wt(r);if(!xe)return r;var i=r==null?void 0:r.nodeType;if(n&&i!==3){var s=mn();return r===null?o==null||o.after(s):r.before(s),bt(s),s}return bt(r),r}function qi(e){e.textContent=""}function Un(e){var t=zt|hn;ke===null?t|=Tn:ke.f|=vl;var n=Ve!==null&&Ve.f&zt?Ve:null;const r={children:null,ctx:Te,deps:null,equals:yl,f:t,fn:e,reactions:null,v:null,version:0,parent:n??ke};return n!==null&&(n.children??(n.children=[])).push(r),r}function ce(e){const t=Un(e);return t.equals=Wi,t}function Cl(e){var t=e.children;if(t!==null){e.children=null;for(var n=0;n<t.length;n+=1){var r=t[n];r.f&zt?Gi(r):Lt(r)}}}function Gd(e){for(var t=e.parent;t!==null;){if(!(t.f&zt))return t;t=t.parent}return null}function kl(e){var t,n=ke;Kt(Gd(e));try{Cl(e),t=Yl(e)}finally{Kt(n)}return t}function El(e){var t=kl(e),n=(Dn||e.f&Tn)&&e.deps!==null?qn:ct;It(e,n),e.equals(t)||(e.v=t,e.version=Vl())}function Gi(e){Cl(e),$r(e,0),It(e,Gn),e.v=e.children=e.deps=e.ctx=e.reactions=null}function Sl(e){ke===null&&Ve===null&&Yd(),Ve!==null&&Ve.f&Tn&&Vd(),es&&Rd()}function Ud(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function An(e,t,n,r=!0){var o=(e&Zn)!==0,i=ke,s={ctx:Te,deps:null,deriveds:null,nodes_start:null,nodes_end:null,f:e|hn,first:null,fn:t,last:null,next:null,parent:o?null:i,prev:null,teardown:null,transitions:null,version:0};if(n){var l=Qn;try{Hl(!0),Rr(s),s.f|=Ld}catch(c){throw Lt(s),c}finally{Hl(l)}}else t!==null&&Oo(s);var u=n&&s.deps===null&&s.first===null&&s.nodes_start===null&&s.teardown===null&&(s.f&vl)===0;if(!u&&!o&&r&&(i!==null&&Ud(s,i),Ve!==null&&Ve.f&zt)){var a=Ve;(a.children??(a.children=[])).push(s)}return s}function Pl(e){const t=An(Or,null,!1);return It(t,ct),t.teardown=e,t}function Ui(e){Sl();var t=ke!==null&&(ke.f&Dt)!==0&&Te!==null&&!Te.m;if(t){var n=Te;(n.e??(n.e=[])).push({fn:e,effect:ke,reaction:Ve})}else{var r=xt(e);return r}}function jd(e){return Sl(),jn(e)}function Jd(e){const t=An(Zn,e,!0);return()=>{Lt(t)}}function Qd(e){const t=An(Zn,e,!0);return(n={})=>new Promise(r=>{n.outro?Dr(t,()=>{Lt(t),r(void 0)}):(Lt(t),r(void 0))})}function xt(e){return An(gl,e,!1)}function oe(e,t){var n=Te,r={effect:null,ran:!1};n.l.r1.push(r),r.effect=jn(()=>{e(),!r.ran&&(r.ran=!0,X(n.l.r2,!0),Zt(t))})}function st(){var e=Te;jn(()=>{if(g(e.l.r2)){for(var t of e.l.r1){var n=t.effect;n.f&ct&&It(n,qn),tr(n)&&Rr(n),t.ran=!1}e.l.r2.v=!1}})}function jn(e){return An(Or,e,!0)}function pe(e){return Jn(e)}function Jn(e,t=0){return An(Or|Vi|t,e,!0)}function pn(e,t=!0){return An(Or|Dt,e,!0,t)}function Ml(e){var t=e.teardown;if(t!==null){const n=es,r=Ve;$l(!0),wn(null);try{t.call(null)}finally{$l(n),wn(r)}}}function Nl(e){var t=e.deriveds;if(t!==null){e.deriveds=null;for(var n=0;n<t.length;n+=1)Gi(t[n])}}function Ol(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){var r=n.next;Lt(n,t),n=r}}function ef(e){for(var t=e.first;t!==null;){var n=t.next;t.f&Dt||Lt(t),t=n}}function Lt(e,t=!0){var n=!1;if((t||e.f&Hd)&&e.nodes_start!==null){for(var r=e.nodes_start,o=e.nodes_end;r!==null;){var i=r===o?null:Wt(r);r.remove(),r=i}n=!0}Ol(e,t&&!n),Nl(e),$r(e,0),It(e,Gn);var s=e.transitions;if(s!==null)for(const u of s)u.stop();Ml(e);var l=e.parent;l!==null&&l.first!==null&&Tl(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function Tl(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Dr(e,t){var n=[];ji(e,n,!0),Al(n,()=>{Lt(e),t&&t()})}function Al(e,t){var n=e.length;if(n>0){var r=()=>--n||t();for(var o of e)o.out(r)}else t()}function ji(e,t,n){if(!(e.f&Xt)){if(e.f^=Xt,e.transitions!==null)for(const s of e.transitions)(s.is_global||n)&&t.push(s);for(var r=e.first;r!==null;){var o=r.next,i=(r.f&Tr)!==0||(r.f&Dt)!==0;ji(r,t,i?n:!1),r=o}}}function Co(e){zl(e,!0)}function zl(e,t){if(e.f&Xt){tr(e)&&Rr(e),e.f^=Xt;for(var n=e.first;n!==null;){var r=n.next,o=(n.f&Tr)!==0||(n.f&Dt)!==0;zl(n,o?t:!1),n=r}if(e.transitions!==null)for(const i of e.transitions)(i.is_global||t)&&i.in()}}const tf=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let ko=!1,Eo=!1,Ji=[],Qi=[];function Dl(){ko=!1;const e=Ji.slice();Ji=[],Nr(e)}function Ll(){Eo=!1;const e=Qi.slice();Qi=[],Nr(e)}function Lr(e){ko||(ko=!0,queueMicrotask(Dl)),Ji.push(e)}function nf(e){Eo||(Eo=!0,tf(Ll)),Qi.push(e)}function rf(){ko&&Dl(),Eo&&Ll()}function So(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}const Il=0,of=1;let Po=!1,Mo=Il,Ir=!1,Hr=null,Qn=!1,es=!1;function Hl(e){Qn=e}function $l(e){es=e}let zn=[],er=0,ep=[],Ve=null;function wn(e){Ve=e}let ke=null;function Kt(e){ke=e}let Ft=null;function sf(e){Ft=e}let lt=null,Ct=0,_n=null;function lf(e){_n=e}let Rl=1,Dn=!1,Te=null;function Vl(){return++Rl}function ts(){return!Ke||Te!==null&&Te.l===null}function tr(e){var s,l;var t=e.f;if(t&hn)return!0;if(t&qn){var n=e.deps,r=(t&Tn)!==0;if(n!==null){var o;if(t&bo){for(o=0;o<n.length;o++)((s=n[o]).reactions??(s.reactions=[])).push(e);e.f^=bo}for(o=0;o<n.length;o++){var i=n[o];if(tr(i)&&El(i),r&&ke!==null&&!Dn&&!((l=i==null?void 0:i.reactions)!=null&&l.includes(e))&&(i.reactions??(i.reactions=[])).push(e),i.version>e.version)return!0}}(!r||ke!==null&&!Dn)&&It(e,ct)}return!1}function af(e,t){for(var n=t;n!==null;){if(n.f&Yi)try{n.fn(e);return}catch{n.f^=Yi}n=n.parent}throw Po=!1,e}function cf(e){return(e.f&Gn)===0&&(e.parent===null||(e.parent.f&Yi)===0)}function No(e,t,n,r){if(Po){if(n===null&&(Po=!1),cf(t))throw e;return}n!==null&&(Po=!0);{af(e,t);return}}function Yl(e){var f;var t=lt,n=Ct,r=_n,o=Ve,i=Dn,s=Ft,l=Te,u=e.f;lt=null,Ct=0,_n=null,Ve=u&(Dt|Zn)?null:e,Dn=!Qn&&(u&Tn)!==0,Ft=null,Te=e.ctx;try{var a=(0,e.fn)(),c=e.deps;if(lt!==null){var d;if($r(e,Ct),c!==null&&Ct>0)for(c.length=Ct+lt.length,d=0;d<lt.length;d++)c[Ct+d]=lt[d];else e.deps=c=lt;if(!Dn)for(d=Ct;d<c.length;d++)((f=c[d]).reactions??(f.reactions=[])).push(e)}else c!==null&&Ct<c.length&&($r(e,Ct),c.length=Ct);return a}finally{lt=t,Ct=n,_n=r,Ve=o,Dn=i,Ft=s,Te=l}}function uf(e,t){let n=t.reactions;if(n!==null){var r=n.indexOf(e);if(r!==-1){var o=n.length-1;o===0?n=t.reactions=null:(n[r]=n[o],n.pop())}}n===null&&t.f&zt&&(lt===null||!lt.includes(t))&&(It(t,qn),t.f&(Tn|bo)||(t.f^=bo),$r(t,0))}function $r(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)uf(e,n[r])}function Rr(e){var t=e.f;if(!(t&Gn)){It(e,ct);var n=ke,r=Te;ke=e;try{t&Vi?ef(e):Ol(e),Nl(e),Ml(e);var o=Yl(e);e.teardown=typeof o=="function"?o:null,e.version=Rl}catch(i){No(i,e,n,r||e.ctx)}finally{ke=n}}}function Bl(){if(er>1e3){er=0;try{Bd()}catch(e){if(Hr!==null)No(e,Hr,null);else throw e}}er++}function Xl(e){var t=e.length;if(t!==0){Bl();var n=Qn;Qn=!0;try{for(var r=0;r<t;r++){var o=e[r];o.f&ct||(o.f^=ct);var i=[];Wl(o,i),df(i)}}finally{Qn=n}}}function df(e){var t=e.length;if(t!==0)for(var n=0;n<t;n++){var r=e[n];if(!(r.f&(Gn|Xt)))try{tr(r)&&(Rr(r),r.deps===null&&r.first===null&&r.nodes_start===null&&(r.teardown===null?Tl(r):r.fn=null))}catch(o){No(o,r,null,r.ctx)}}}function ff(){if(Ir=!1,er>1001)return;const e=zn;zn=[],Xl(e),Ir||(er=0,Hr=null)}function Oo(e){Mo===Il&&(Ir||(Ir=!0,queueMicrotask(ff))),Hr=e;for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(n&(Zn|Dt)){if(!(n&ct))return;t.f^=ct}}zn.push(t)}function Wl(e,t){var n=e.first,r=[];e:for(;n!==null;){var o=n.f,i=(o&Dt)!==0,s=i&&(o&ct)!==0,l=n.next;if(!s&&!(o&Xt))if(o&Or){if(i)n.f^=ct;else try{tr(n)&&Rr(n)}catch(d){No(d,n,null,n.ctx)}var u=n.first;if(u!==null){n=u;continue}}else o&gl&&r.push(n);if(l===null){let d=n.parent;for(;d!==null;){if(e===d)break e;var a=d.next;if(a!==null){n=a;continue e}d=d.parent}}n=l}for(var c=0;c<r.length;c++)u=r[c],t.push(u),Wl(u,t)}function m(e){var t=Mo,n=zn;try{Bl();const o=[];Mo=of,zn=o,Ir=!1,Xl(n);var r=e==null?void 0:e();return rf(),(zn.length>0||o.length>0)&&m(),er=0,Hr=null,r}finally{Mo=t,zn=n}}function g(e){var c;var t=e.f,n=(t&zt)!==0;if(n&&t&Gn){var r=kl(e);return Gi(e),r}if(Ve!==null){Ft!==null&&Ft.includes(e)&&Zd();var o=Ve.deps;lt===null&&o!==null&&o[Ct]===e?Ct++:lt===null?lt=[e]:lt.push(e),_n!==null&&ke!==null&&ke.f&ct&&!(ke.f&Dt)&&_n.includes(e)&&(It(ke,hn),Oo(ke))}else if(n&&e.deps===null)for(var i=e,s=i.parent,l=i;s!==null;)if(s.f&zt){var u=s;l=u,s=u.parent}else{var a=s;(c=a.deriveds)!=null&&c.includes(l)||(a.deriveds??(a.deriveds=[])).push(l);break}return n&&(i=e,tr(i)&&El(i)),e.v}function Zt(e){const t=Ve;try{return Ve=null,e()}finally{Ve=t}}const hf=~(hn|qn|ct);function It(e,t){e.f=e.f&hf|t}function To(e){return ns().get(e)}function nr(e,t){return ns().set(e,t),t}function gf(e){return ns().has(e)}function ns(e){return Te===null&&So(),Te.c??(Te.c=new Map(vf(Te)||void 0))}function vf(e){let t=e.p;for(;t!==null;){const n=t.c;if(n!==null)return n;t=t.p}return null}function Kl(e,t=1){var n=g(e),r=t===1?n++:n--;return X(e,n),r}function ue(e,t=!1,n){Te={p:Te,c:null,e:null,m:!1,s:e,x:null,l:null},Ke&&!t&&(Te.l={s:null,u:null,r1:[],r2:yt(!1)})}function de(e){const t=Te;if(t!==null){e!==void 0&&(t.x=e);const s=t.e;if(s!==null){var n=ke,r=Ve;t.e=null;try{for(var o=0;o<s.length;o++){var i=s[o];Kt(i.effect),wn(i.reaction),xt(i.fn)}}finally{Kt(n),wn(r)}}Te=t.p,t.m=!0}return e||{}}function B(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(gn in e)rs(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&gn in n&&rs(n)}}}function rs(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let r in e)try{rs(e[r],t)}catch{}const n=Ri(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=hl(n);for(let o in r){const i=r[o].get;if(i)try{i.call(e)}catch{}}}}}function yf(e,t){if(t){const n=document.body;e.autofocus=!0,Lr(()=>{document.activeElement===n&&e.focus()})}}function mf(e){xe&&pt(e)!==null&&qi(e)}let Fl=!1;function pf(){Fl||(Fl=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function wf(e){var t=Ve,n=ke;wn(null),Kt(null);try{return e()}finally{wn(t),Kt(n)}}const Zl=new Set,os=new Set;function ql(e,t,n,r){function o(i){if(r.capture||Vr.call(t,i),!i.cancelBubble)return wf(()=>n.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Lr(()=>{t.addEventListener(e,o,r)}):t.addEventListener(e,o,r),o}function Be(e,t,n,r,o){var i={capture:r,passive:o},s=ql(e,t,n,i);(t===document.body||t===window||t===document)&&Pl(()=>{t.removeEventListener(e,s,i)})}function Ao(e){for(var t=0;t<e.length;t++)Zl.add(e[t]);for(var n of os)n(e)}function Vr(e){var v;var t=this,n=t.ownerDocument,r=e.type,o=((v=e.composedPath)==null?void 0:v.call(e))||[],i=o[0]||e.target,s=0,l=e.__root;if(l){var u=o.indexOf(l);if(u!==-1&&(t===document||t===window)){e.__root=t;return}var a=o.indexOf(t);if(a===-1)return;u<=a&&(s=u)}if(i=o[s]||e.target,i!==t){_o(e,"currentTarget",{configurable:!0,get(){return i||n}});var c=Ve,d=ke;wn(null),Kt(null);try{for(var f,h=[];i!==null;){var y=i.assignedSlot||i.parentNode||i.host||null;try{var _=i["__"+r];if(_!==void 0&&!i.disabled)if(Pr(_)){var[C,...w]=_;C.apply(i,[e,...w])}else _.call(i,e)}catch(E){f?h.push(E):f=E}if(e.cancelBubble||y===t||y===null)break;i=y}if(f){for(let E of h)queueMicrotask(()=>{throw E});throw f}}finally{e.__root=t,delete e.currentTarget,wn(c),Kt(d)}}}function is(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function kt(e,t){var n=ke;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function ve(e,t){var n=(t&ul)!==0,r=(t&kd)!==0,o,i=!e.startsWith("<!>");return()=>{if(xe)return kt(Me,null),Me;o===void 0&&(o=is(i?e:"<!>"+e),n||(o=pt(o)));var s=r?document.importNode(o,!0):o.cloneNode(!0);if(n){var l=pt(s),u=s.lastChild;kt(l,u)}else kt(s,s);return s}}function je(e,t,n="svg"){var r=!e.startsWith("<!>"),o=(t&ul)!==0,i=`<${n}>${r?e:"<!>"+e}</${n}>`,s;return()=>{if(xe)return kt(Me,null),Me;if(!s){var l=is(i),u=pt(l);if(o)for(s=document.createDocumentFragment();pt(u);)s.appendChild(pt(u));else s=pt(u)}var a=s.cloneNode(!0);if(o){var c=pt(a),d=a.lastChild;kt(c,d)}else kt(a,a);return a}}function Yr(e=""){if(!xe){var t=mn(e+"");return kt(t,t),t}var n=Me;return n.nodeType!==3&&(n.before(n=mn()),bt(n)),kt(n,n),n}function at(){if(xe)return kt(Me,null),Me;var e=document.createDocumentFragment(),t=document.createComment(""),n=mn();return e.append(t,n),kt(t,n),e}function K(e,t){if(xe){ke.nodes_end=Me,vn();return}e!==null&&e.before(t)}function bn(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=n,e.nodeValue=n==null?"":n+"")}function Gl(e,t){return Ul(e,t)}function _f(e,t){Zi(),t.intro=t.intro??!1;const n=t.target,r=xe,o=Me;try{for(var i=pt(n);i&&(i.nodeType!==8||i.data!==dl);)i=Wt(i);if(!i)throw Fn;rn(!0),bt(i),vn();const s=Ul(e,{...t,anchor:i});if(Me===null||Me.nodeType!==8||Me.data!==Hi)throw xo(),Fn;return rn(!1),s}catch(s){if(s===Fn)return t.recover===!1&&Xd(),Zi(),qi(n),rn(!1),Gl(e,t);throw s}finally{rn(r),bt(o)}}const rr=new Map;function Ul(e,{target:t,anchor:n,props:r={},events:o,context:i,intro:s=!0}){Zi();var l=new Set,u=d=>{for(var f=0;f<d.length;f++){var h=d[f];if(!l.has(h)){l.add(h);var y=Td(h);t.addEventListener(h,Vr,{passive:y});var _=rr.get(h);_===void 0?(document.addEventListener(h,Vr,{passive:y}),rr.set(h,1)):rr.set(h,_+1)}}};u($i(Zl)),os.add(u);var a=void 0,c=Qd(()=>{var d=n??t.appendChild(mn());return pn(()=>{if(i){ue({});var f=Te;f.c=i}o&&(r.$$events=o),xe&&kt(d,null),a=e(d,r)||{},xe&&(ke.nodes_end=Me),i&&de()}),()=>{var y;for(var f of l){t.removeEventListener(f,Vr);var h=rr.get(f);--h===0?(document.removeEventListener(f,Vr),rr.delete(f)):rr.set(f,h)}os.delete(u),d!==n&&((y=d.parentNode)==null||y.removeChild(d))}});return ss.set(a,c),a}let ss=new WeakMap;function bf(e,t){const n=ss.get(e);return n?(ss.delete(e),n(t)):Promise.resolve()}function We(e,t,n=!1){xe&&vn();var r=e,o=null,i=null,s=vt,l=n?Tr:0,u=!1;const a=(d,f=!0)=>{u=!0,c(f,d)},c=(d,f)=>{if(s===(s=d))return;let h=!1;if(xe){const y=r.data===Ii;!!s===y&&(r=Fi(),bt(r),rn(!1),h=!0)}s?(o?Co(o):f&&(o=pn(()=>f(r))),i&&Dr(i,()=>{i=null})):(i?Co(i):f&&(i=pn(()=>f(r))),o&&Dr(o,()=>{o=null})),h&&rn(!0)};Jn(()=>{u=!1,t(a),u||c(null,null)},l),xe&&(r=Me)}function zo(e,t){return t}function xf(e,t,n,r){for(var o=[],i=t.length,s=0;s<i;s++)ji(t[s].e,o,!0);var l=i>0&&o.length===0&&n!==null;if(l){var u=n.parentNode;qi(u),u.append(n),r.clear(),Cn(e,t[0].prev,t[i-1].next)}Al(o,()=>{for(var a=0;a<i;a++){var c=t[a];l||(r.delete(c.k),Cn(e,c.prev,c.next)),Lt(c.e,!l)}})}function xn(e,t,n,r,o,i=null){var s=e,l={flags:t,items:new Map,first:null},u=(t&al)!==0;if(u){var a=e;s=xe?bt(pt(a)):a.appendChild(mn())}xe&&vn();var c=null,d=!1;Jn(()=>{var f=n(),h=Pr(f)?f:f==null?[]:$i(f),y=h.length;if(d&&y===0)return;d=y===0;let _=!1;if(xe){var C=s.data===Ii;C!==(y===0)&&(s=Fi(),bt(s),rn(!1),_=!0)}if(xe){for(var w=null,v,E=0;E<y;E++){if(Me.nodeType===8&&Me.data===Hi){s=Me,_=!0,rn(!1);break}var S=h[E],x=r(S,E);v=jl(Me,l,w,null,S,x,E,o,t),l.items.set(x,v),w=v}y>0&&bt(Fi())}if(!xe){var P=Ve;Cf(h,l,s,o,t,(P.f&Xt)!==0,r)}i!==null&&(y===0?c?Co(c):c=pn(()=>i(s)):c!==null&&Dr(c,()=>{c=null})),_&&rn(!0),n()}),xe&&(s=Me)}function Cf(e,t,n,r,o,i,s,l){var I,b,M,A;var u=(o&pd)!==0,a=(o&(Di|Li))!==0,c=e.length,d=t.items,f=t.first,h=f,y,_=null,C,w=[],v=[],E,S,x,P;if(u)for(P=0;P<c;P+=1)E=e[P],S=s(E,P),x=d.get(S),x!==void 0&&((I=x.a)==null||I.measure(),(C??(C=new Set)).add(x));for(P=0;P<c;P+=1){if(E=e[P],S=s(E,P),x=d.get(S),x===void 0){var N=h?h.e.nodes_start:n;_=jl(N,t,_,_===null?t.first:_.next,E,S,P,r,o),d.set(S,_),w=[],v=[],h=_.next;continue}if(a&&kf(x,E,P,o),x.e.f&Xt&&(Co(x.e),u&&((b=x.a)==null||b.unfix(),(C??(C=new Set)).delete(x))),x!==h){if(y!==void 0&&y.has(x)){if(w.length<v.length){var O=v[0],T;_=O.prev;var L=w[0],V=w[w.length-1];for(T=0;T<w.length;T+=1)Jl(w[T],O,n);for(T=0;T<v.length;T+=1)y.delete(v[T]);Cn(t,L.prev,V.next),Cn(t,_,L),Cn(t,V,O),h=O,_=V,P-=1,w=[],v=[]}else y.delete(x),Jl(x,h,n),Cn(t,x.prev,x.next),Cn(t,x,_===null?t.first:_.next),Cn(t,_,x),_=x;continue}for(w=[],v=[];h!==null&&h.k!==S;)(i||!(h.e.f&Xt))&&(y??(y=new Set)).add(h),v.push(h),h=h.next;if(h===null)continue;x=h}w.push(x),_=x,h=x.next}if(h!==null||y!==void 0){for(var $=y===void 0?[]:$i(y);h!==null;)(i||!(h.e.f&Xt))&&$.push(h),h=h.next;var H=$.length;if(H>0){var k=o&al&&c===0?n:null;if(u){for(P=0;P<H;P+=1)(M=$[P].a)==null||M.measure();for(P=0;P<H;P+=1)(A=$[P].a)==null||A.fix()}xf(t,$,k,d)}}u&&Lr(()=>{var D;if(C!==void 0)for(x of C)(D=x.a)==null||D.apply()}),ke.first=t.first&&t.first.e,ke.last=_&&_.e}function kf(e,t,n,r){r&Di&&Ki(e.v,t),r&Li?Ki(e.i,n):e.i=n}function jl(e,t,n,r,o,i,s,l,u,a){var c=(u&Di)!==0,d=(u&wd)===0,f=c?d?Ar(o):yt(o):o,h=u&Li?yt(s):s,y={i:h,v:f,k:i,a:null,e:null,prev:n,next:r};try{return y.e=pn(()=>l(e,f,h),xe),y.e.prev=n&&n.e,y.e.next=r&&r.e,n===null?t.first=y:(n.next=y,n.e.next=y.e),r!==null&&(r.prev=y,r.e.prev=y.e),y}finally{}}function Jl(e,t,n){for(var r=e.next?e.next.e.nodes_start:n,o=t?t.e.nodes_start:n,i=e.e.nodes_start;i!==r;){var s=Wt(i);o.before(i),i=s}}function Cn(e,t,n){t===null?e.first=n:(t.next=n,t.e.next=n&&n.e),n!==null&&(n.prev=t,n.e.prev=t&&t.e)}function Ql(e,t,n,r,o){var i=e,s="",l;Jn(()=>{if(s===(s=t()??"")){xe&&vn();return}l!==void 0&&(Lt(l),l=void 0),s!==""&&(l=pn(()=>{if(xe){Me.data;for(var u=vn(),a=u;u!==null&&(u.nodeType!==8||u.data!=="");)a=u,u=Wt(u);if(u===null)throw xo(),Fn;kt(Me,a),i=bt(u);return}var c=s+"",d=is(c);kt(pt(d),d.lastChild),i.before(d)}))})}function et(e,t,n,r,o){var l;xe&&vn();var i=(l=t.$$slots)==null?void 0:l[n],s=!1;i===!0&&(i=t[n==="default"?"children":n],s=!0),i===void 0?o!==null&&o(e):i(e,s?()=>r:r)}function Ef(e){const t={};e.children&&(t.default=!0);for(const n in e.$$slots)t[n]=!0;return t}function Do(e,t,...n){var r=e,o=Mt,i;Jn(()=>{o!==(o=t())&&(i&&(Lt(i),i=null),i=pn(()=>o(r,...n)))},Tr),xe&&(r=Me)}function ea(e,t,n){xe&&vn();var r=e,o,i;Jn(()=>{o!==(o=t())&&(i&&(Dr(i),i=null),o&&(i=pn(()=>n(r,o))))},Tr),xe&&(r=Me)}function qt(e,t){Lr(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+t.hash)){const o=document.createElement("style");o.id=t.hash,o.textContent=t.code,r.appendChild(o)}})}function ut(e,t,n){xt(()=>{var r=Zt(()=>t(e,n==null?void 0:n())||{});if(n&&(r!=null&&r.update)){var o=!1,i={};jn(()=>{var s=n();B(s),o&&Xi(i,s)&&(i=s,r.update(s))}),o=!0}if(r!=null&&r.destroy)return()=>r.destroy()})}function ta(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=ta(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Sf(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ta(e))&&(r&&(r+=" "),r+=t);return r}function Gt(e){return typeof e=="object"?Sf(e):e??""}function na(e){if(xe){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var r=e.value;ee(e,"value",null),e.value=r}if(e.hasAttribute("checked")){var o=e.checked;ee(e,"checked",null),e.checked=o}}};e.__on_r=n,nf(n),pf()}}function Pf(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function ee(e,t,n,r){var o=e.__attributes??(e.__attributes={});xe&&(o[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||o[t]!==(o[t]=n)&&(t==="style"&&"__styles"in e&&(e.__styles={}),t==="loading"&&(e[$d]=n),n==null?e.removeAttribute(t):typeof n!="string"&&oa(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Ut(e,t,n,r,o=!1,i=!1,s=!1){var l=t||{},u=e.tagName==="OPTION";for(var a in t)a in n||(n[a]=null);n.class&&(n.class=Gt(n.class)),r!==void 0&&(n.class=n.class?n.class+" "+r:r);var c=oa(e),d=e.__attributes??(e.__attributes={});for(const w in n){let v=n[w];if(u&&w==="value"&&v==null){e.value=e.__value="",l[w]=v;continue}var f=l[w];if(v!==f){l[w]=v;var h=w[0]+w[1];if(h!=="$$"){if(h==="on"){const E={},S="$$"+w;let x=w.slice(2);var y=Pd(x);if(Ed(x)&&(x=x.slice(0,-7),E.capture=!0),!y&&f){if(v!=null)continue;e.removeEventListener(x,l[S],E),l[S]=null}if(v!=null)if(y)e[`__${x}`]=v,Ao([x]);else{let P=function(N){l[w].call(this,N)};l[S]=ql(x,e,P,E)}else y&&(e[`__${x}`]=void 0)}else if(w==="style"&&v!=null)e.style.cssText=v+"";else if(w==="autofocus")yf(e,!!v);else if(w==="__value"||w==="value"&&v!=null)e.value=e[w]=e.__value=v;else if(w==="selected"&&u)Pf(e,v);else{var _=w;o||(_=Nd(_));var C=_==="defaultValue"||_==="defaultChecked";if(v==null&&!i&&!C)if(d[w]=null,_==="value"||_==="checked"){let E=e;if(_==="value"){let S=E.defaultValue;E.removeAttribute(_),E.defaultValue=S}else{let S=E.defaultChecked;E.removeAttribute(_),E.defaultChecked=S}}else e.removeAttribute(w);else C||c.includes(_)&&(i||typeof v!="string")?e[_]=v:typeof v!="function"&&(xe&&(_==="src"||_==="href"||_==="srcset")||ee(e,_,v))}w==="style"&&"__styles"in e&&(e.__styles={})}}}return l}var ra=new Map;function oa(e){var t=ra.get(e.nodeName);if(t)return t;ra.set(e.nodeName,t=[]);for(var n,r=e,o=Element.prototype;o!==r;){n=hl(r);for(var i in n)n[i].set&&t.push(i);r=Ri(r)}return t}function Ln(e,t,n){var r=e.__className,o=ia(t,n);xe&&e.getAttribute("class")===o?e.__className=o:(r!==o||xe&&e.getAttribute("class")!==o)&&(o===""?e.removeAttribute("class"):e.setAttribute("class",o),e.__className=o)}function or(e,t,n){var r=e.__className,o=ia(t,n);xe&&e.className===o?e.__className=o:(r!==o||xe&&e.className!==o)&&(t==null&&!n?e.removeAttribute("class"):e.className=o,e.__className=o)}function ia(e,t){return(e??"")+(t?" "+t:"")}function qe(e,t,n){if(n){if(e.classList.contains(t))return;e.classList.add(t)}else{if(!e.classList.contains(t))return;e.classList.remove(t)}}function nt(e,t,n,r){var o=e.__styles??(e.__styles={});o[t]!==n&&(o[t]=n,n==null?e.style.removeProperty(t):e.style.setProperty(t,n,""))}const Ti=class Ti{constructor(t){Kn(this,Oi);Kn(this,Nn,new WeakMap);Kn(this,Sr);Kn(this,fo);mo(this,fo,t)}observe(t,n){var r=Ue(this,Nn).get(t)||new Set;return r.add(n),Ue(this,Nn).set(t,r),yd(this,Oi,md).call(this).observe(t,Ue(this,fo)),()=>{var o=Ue(this,Nn).get(t);o.delete(n),o.size===0&&(Ue(this,Nn).delete(t),Ue(this,Sr).unobserve(t))}}};Nn=new WeakMap,Sr=new WeakMap,fo=new WeakMap,Oi=new WeakSet,md=function(){return Ue(this,Sr)??mo(this,Sr,new ResizeObserver(t=>{for(var n of t){Ti.entries.set(n.target,n);for(var r of Ue(this,Nn).get(n.target)||[])r(n)}}))},gt(Ti,"entries",new WeakMap);let ls=Ti;var Mf=new ls({box:"border-box"});function sa(e,t,n){var r=Mf.observe(e,()=>n(e[t]));xt(()=>(Zt(()=>n(e[t])),r))}function la(e,t){return e===t||(e==null?void 0:e[gn])===t}function ir(e={},t,n,r){return xt(()=>{var o,i;return jn(()=>{o=i,i=[],Zt(()=>{e!==n(...i)&&(t(e,...i),o&&la(n(...o),e)&&t(null,...o))})}),()=>{Lr(()=>{i&&la(n(...i),e)&&t(null,...i)})}}),e}function me(e=!1){const t=Te,n=t.l.u;if(!n)return;let r=()=>B(t.s);if(e){let o=0,i={};const s=Un(()=>{let l=!1;const u=t.s;for(const a in u)u[a]!==i[a]&&(i[a]=u[a],l=!0);return l&&o++,o});r=()=>g(s)}n.b.length&&jd(()=>{aa(t,r),Nr(n.b)}),Ui(()=>{const o=Zt(()=>n.m.map(Dd));return()=>{for(const i of o)typeof i=="function"&&i()}}),n.a.length&&Ui(()=>{aa(t,r),Nr(n.a)})}function aa(e,t){if(e.l.s)for(const n of e.l.s)g(n);t()}function Ne(e,t){var i;var n=(i=e.$$events)==null?void 0:i[t.type],r=Pr(n)?n.slice():n==null?[]:[n];for(var o of r)o.call(this,t)}function sr(e){Te===null&&So(),Ke&&Te.l!==null?Of(Te).m.push(e):Ui(()=>{const t=Zt(e);if(typeof t=="function")return t})}function as(e){Te===null&&So(),sr(()=>()=>Zt(e))}function Nf(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function Lo(){const e=Te;return e===null&&So(),(t,n,r)=>{var i;const o=(i=e.s.$$events)==null?void 0:i[t];if(o){const s=Pr(o)?o.slice():[o],l=Nf(t,n,r);for(const u of s)u.call(e.x,l);return!l.defaultPrevented}return!0}}function Of(e){var t=e.l;return t.u??(t.u={a:[],b:[],m:[]})}function cs(e,t,n){if(e==null)return t(void 0),n&&n(void 0),Mt;const r=Zt(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}let Io=!1;function U(e,t,n){const r=n[t]??(n[t]={store:null,source:Ar(void 0),unsubscribe:Mt});if(r.store!==e)if(r.unsubscribe(),r.store=e??null,e==null)r.source.v=void 0,r.unsubscribe=Mt;else{var o=!0;r.unsubscribe=cs(e,i=>{o?r.source.v=i:X(r.source,i)}),o=!1}return g(r.source)}function Tf(e,t,n){let r=n[t];return r&&r.store!==e&&(r.unsubscribe(),r.unsubscribe=Mt),e}function Ho(e,t){return e.set(t),t}function ot(){const e={};return Pl(()=>{for(var t in e)e[t].unsubscribe()}),e}function Af(e){var t=Io;try{return Io=!1,[e(),Io]}finally{Io=t}}const zf={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function us(e,t,n){return new Proxy({props:e,exclude:t},zf)}const Df={get(e,t){if(!e.exclude.includes(t))return g(e.version),t in e.special?e.special[t]():e.props[t]},set(e,t,n){return t in e.special||(e.special[t]=p({get[t](){return e.props[t]}},t,cl)),e.special[t](n),Kl(e.version),!0},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},deleteProperty(e,t){return e.exclude.includes(t)||(e.exclude.push(t),Kl(e.version)),!0},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function Se(e,t){return new Proxy({props:e,exclude:t,special:{},version:yt(0)},Df)}const Lf={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Mr(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let o=e.props[r];Mr(o)&&(o=o());const i=nn(o,t);if(i&&i.set)return i.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Mr(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r){const o=nn(r,t);return o&&!o.configurable&&(o.configurable=!0),o}}},has(e,t){if(t===gn||t===Bi)return!1;for(let n of e.props)if(Mr(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){const t=[];for(let n of e.props){Mr(n)&&(n=n());for(const r in n)t.includes(r)||t.push(r)}return t}};function In(...e){return new Proxy({props:e},Lf)}function ca(e){for(var t=ke,n=ke;t!==null&&!(t.f&(Dt|Zn));)t=t.parent;try{return Kt(t),e()}finally{Kt(n)}}function p(e,t,n,r){var N;var o=(n&_d)!==0,i=!Ke||(n&bd)!==0,s=(n&xd)!==0,l=(n&Cd)!==0,u=!1,a;s?[a,u]=Af(()=>e[t]):a=e[t];var c=gn in e||Bi in e,d=((N=nn(e,t))==null?void 0:N.set)??(c&&s&&t in e?O=>e[t]=O:void 0),f=r,h=!0,y=!1,_=()=>(y=!0,h&&(h=!1,l?f=Zt(r):f=r),f);a===void 0&&r!==void 0&&(d&&i&&Wd(),a=_(),d&&d(a));var C;if(i)C=()=>{var O=e[t];return O===void 0?_():(h=!0,y=!1,O)};else{var w=ca(()=>(o?Un:ce)(()=>e[t]));w.f|=Id,C=()=>{var O=g(w);return O!==void 0&&(f=void 0),O===void 0?f:O}}if(!(n&cl))return C;if(d){var v=e.$$legacy;return function(O,T){return arguments.length>0?((!i||!T||v||u)&&d(T?C():O),O):C()}}var E=!1,S=!1,x=Ar(a),P=ca(()=>Un(()=>{var O=C(),T=g(x);return E?(E=!1,S=!0,T):(S=!1,x.v=O)}));return o||(P.equals=Wi),function(O,T){if(arguments.length>0){const L=T?g(P):i&&s?yn(O):O;return P.equals(L)||(E=!0,X(x,L),y&&f!==void 0&&(f=L),Zt(()=>g(P))),O}return g(P)}}function If(e){return new Hf(e)}class Hf{constructor(t){Kn(this,dn);Kn(this,Tt);var i;var n=new Map,r=(s,l)=>{var u=Ar(l);return n.set(s,u),u};const o=new Proxy({...t.props||{},$$events:{}},{get(s,l){return g(n.get(l)??r(l,Reflect.get(s,l)))},has(s,l){return l===Bi?!0:(g(n.get(l)??r(l,Reflect.get(s,l))),Reflect.has(s,l))},set(s,l,u){return X(n.get(l)??r(l,u),u),Reflect.set(s,l,u)}});mo(this,Tt,(t.hydrate?_f:Gl)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((i=t==null?void 0:t.props)!=null&&i.$$host)||t.sync===!1)&&m(),mo(this,dn,o.$$events);for(const s of Object.keys(Ue(this,Tt)))s==="$set"||s==="$destroy"||s==="$on"||_o(this,s,{get(){return Ue(this,Tt)[s]},set(l){Ue(this,Tt)[s]=l},enumerable:!0});Ue(this,Tt).$set=s=>{Object.assign(o,s)},Ue(this,Tt).$destroy=()=>{bf(Ue(this,Tt))}}$set(t){Ue(this,Tt).$set(t)}$on(t,n){Ue(this,dn)[t]=Ue(this,dn)[t]||[];const r=(...o)=>n.call(this,...o);return Ue(this,dn)[t].push(r),()=>{Ue(this,dn)[t]=Ue(this,dn)[t].filter(o=>o!==r)}}$destroy(){Ue(this,Tt).$destroy()}}dn=new WeakMap,Tt=new WeakMap;let ua;typeof HTMLElement=="function"&&(ua=class extends HTMLElement{constructor(t,n,r){super();gt(this,"$$ctor");gt(this,"$$s");gt(this,"$$c");gt(this,"$$cn",!1);gt(this,"$$d",{});gt(this,"$$r",!1);gt(this,"$$p_d",{});gt(this,"$$l",{});gt(this,"$$l_u",new Map);gt(this,"$$me");this.$$ctor=t,this.$$s=n,r&&this.attachShadow({mode:"open"})}addEventListener(t,n,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(n),this.$$c){const o=this.$$c.$on(t,n);this.$$l_u.set(n,o)}super.addEventListener(t,n,r)}removeEventListener(t,n,r){if(super.removeEventListener(t,n,r),this.$$c){const o=this.$$l_u.get(n);o&&(o(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(o){return i=>{const s=document.createElement("slot");o!=="default"&&(s.name=o),K(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=$f(this);for(const o of this.$$s)o in r&&(o==="default"&&!this.$$d.children?(this.$$d.children=t(o),n.default=!0):n[o]=t(o));for(const o of this.attributes){const i=this.$$g_p(o.name);i in this.$$d||(this.$$d[i]=$o(i,o.value,this.$$p_d,"toProp"))}for(const o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=If({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=Jd(()=>{jn(()=>{var o;this.$$r=!0;for(const i of wo(this.$$c)){if(!((o=this.$$p_d[i])!=null&&o.reflect))continue;this.$$d[i]=this.$$c[i];const s=$o(i,this.$$d[i],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[i].attribute||i):this.setAttribute(this.$$p_d[i].attribute||i,s)}this.$$r=!1})});for(const o in this.$$l)for(const i of this.$$l[o]){const s=this.$$c.$on(o,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(t,n,r){var o;this.$$r||(t=this.$$g_p(t),this.$$d[t]=$o(t,r,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return wo(this.$$p_d).find(n=>this.$$p_d[n].attribute===t||!this.$$p_d[n].attribute&&n.toLowerCase()===t)||t}});function $o(e,t,n,r){var i;const o=(i=n[e])==null?void 0:i.type;if(t=o==="Boolean"&&typeof t!="boolean"?t!=null:t,!r||!n[e])return t;if(r==="toAttribute")switch(o){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(o){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function $f(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function se(e,t,n,r,o,i){let s=class extends ua{constructor(){super(e,n,o),this.$$p_d=t}static get observedAttributes(){return wo(t).map(l=>(t[l].attribute||l).toLowerCase())}};return wo(t).forEach(l=>{_o(s.prototype,l,{get(){return this.$$c&&l in this.$$c?this.$$c[l]:this.$$d[l]},set(u){var d;u=$o(l,u,t),this.$$d[l]=u;var a=this.$$c;if(a){var c=(d=nn(a,l))==null?void 0:d.get;c?a[l]=u:a.$set({[l]:u})}}})}),r.forEach(l=>{_o(s.prototype,l,{get(){var u;return(u=this.$$c)==null?void 0:u[l]}})}),e.element=s,s}const lr=[];function Nt(e,t){return{subscribe:le(e,t).subscribe}}function le(e,t=Mt){let n=null;const r=new Set;function o(l){if(Xi(e,l)&&(e=l,n)){const u=!lr.length;for(const a of r)a[1](),lr.push(a,e);if(u){for(let a=0;a<lr.length;a+=2)lr[a][0](lr[a+1]);lr.length=0}}}function i(l){o(l(e))}function s(l,u=Mt){const a=[l,u];return r.add(a),r.size===1&&(n=t(o,i)||Mt),l(e),()=>{r.delete(a),r.size===0&&n&&(n(),n=null)}}return{set:o,update:i,subscribe:s}}function ar(e,t,n){const r=!Array.isArray(e),o=r?[e]:e;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const i=t.length<2;return Nt(n,(s,l)=>{let u=!1;const a=[];let c=0,d=Mt;const f=()=>{if(c)return;d();const y=t(r?a[0]:a,s,l);i?s(y):d=typeof y=="function"?y:Mt},h=o.map((y,_)=>cs(y,C=>{a[_]=C,c&=~(1<<_),u&&f()},()=>{c|=1<<_}));return u=!0,f(),function(){Nr(h),d(),u=!1}})}function R(e){let t;return cs(e,n=>t=n)(),t}function dt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=dt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Rf={value:()=>{}};function Ro(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Vo(n)}function Vo(e){this._=e}function Vf(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Vo.prototype=Ro.prototype={constructor:Vo,on:function(e,t){var n=this._,r=Vf(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=Yf(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=da(n[o],e.name,t);else if(t==null)for(o in n)n[o]=da(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Vo(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function Yf(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function da(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=Rf,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ds="http://www.w3.org/1999/xhtml";const fa={svg:"http://www.w3.org/2000/svg",xhtml:ds,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Yo(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),fa.hasOwnProperty(t)?{space:fa[t],local:e}:e}function Bf(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ds&&t.documentElement.namespaceURI===ds?t.createElement(e):t.createElementNS(n,e)}}function Xf(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ha(e){var t=Yo(e);return(t.local?Xf:Bf)(t)}function Wf(){}function fs(e){return e==null?Wf:function(){return this.querySelector(e)}}function Kf(e){typeof e!="function"&&(e=fs(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=new Array(s),u,a,c=0;c<s;++c)(u=i[c])&&(a=e.call(u,u.__data__,c,i))&&("__data__"in u&&(a.__data__=u.__data__),l[c]=a);return new Et(r,this._parents)}function Ff(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Zf(){return[]}function ga(e){return e==null?Zf:function(){return this.querySelectorAll(e)}}function qf(e){return function(){return Ff(e.apply(this,arguments))}}function Gf(e){typeof e=="function"?e=qf(e):e=ga(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],l=s.length,u,a=0;a<l;++a)(u=s[a])&&(r.push(e.call(u,u.__data__,a,s)),o.push(u));return new Et(r,o)}function va(e){return function(){return this.matches(e)}}function ya(e){return function(t){return t.matches(e)}}var Uf=Array.prototype.find;function jf(e){return function(){return Uf.call(this.children,e)}}function Jf(){return this.firstElementChild}function Qf(e){return this.select(e==null?Jf:jf(typeof e=="function"?e:ya(e)))}var eh=Array.prototype.filter;function th(){return Array.from(this.children)}function nh(e){return function(){return eh.call(this.children,e)}}function rh(e){return this.selectAll(e==null?th:nh(typeof e=="function"?e:ya(e)))}function oh(e){typeof e!="function"&&(e=va(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],u,a=0;a<s;++a)(u=i[a])&&e.call(u,u.__data__,a,i)&&l.push(u);return new Et(r,this._parents)}function ma(e){return new Array(e.length)}function ih(){return new Et(this._enter||this._groups.map(ma),this._parents)}function Bo(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Bo.prototype={constructor:Bo,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function sh(e){return function(){return e}}function lh(e,t,n,r,o,i){for(var s=0,l,u=t.length,a=i.length;s<a;++s)(l=t[s])?(l.__data__=i[s],r[s]=l):n[s]=new Bo(e,i[s]);for(;s<u;++s)(l=t[s])&&(o[s]=l)}function ah(e,t,n,r,o,i,s){var l,u,a=new Map,c=t.length,d=i.length,f=new Array(c),h;for(l=0;l<c;++l)(u=t[l])&&(f[l]=h=s.call(u,u.__data__,l,t)+"",a.has(h)?o[l]=u:a.set(h,u));for(l=0;l<d;++l)h=s.call(e,i[l],l,i)+"",(u=a.get(h))?(r[l]=u,u.__data__=i[l],a.delete(h)):n[l]=new Bo(e,i[l]);for(l=0;l<c;++l)(u=t[l])&&a.get(f[l])===u&&(o[l]=u)}function ch(e){return e.__data__}function uh(e,t){if(!arguments.length)return Array.from(this,ch);var n=t?ah:lh,r=this._parents,o=this._groups;typeof e!="function"&&(e=sh(e));for(var i=o.length,s=new Array(i),l=new Array(i),u=new Array(i),a=0;a<i;++a){var c=r[a],d=o[a],f=d.length,h=dh(e.call(c,c&&c.__data__,a,r)),y=h.length,_=l[a]=new Array(y),C=s[a]=new Array(y),w=u[a]=new Array(f);n(c,d,_,C,w,h,t);for(var v=0,E=0,S,x;v<y;++v)if(S=_[v]){for(v>=E&&(E=v+1);!(x=C[E])&&++E<y;);S._next=x||null}}return s=new Et(s,r),s._enter=l,s._exit=u,s}function dh(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function fh(){return new Et(this._exit||this._groups.map(ma),this._parents)}function hh(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function gh(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),l=new Array(o),u=0;u<s;++u)for(var a=n[u],c=r[u],d=a.length,f=l[u]=new Array(d),h,y=0;y<d;++y)(h=a[y]||c[y])&&(f[y]=h);for(;u<o;++u)l[u]=n[u];return new Et(l,this._parents)}function vh(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function yh(e){e||(e=mh);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],l=s.length,u=o[i]=new Array(l),a,c=0;c<l;++c)(a=s[c])&&(u[c]=a);u.sort(t)}return new Et(o,this._parents).order()}function mh(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ph(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function wh(){return Array.from(this)}function _h(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function bh(){let e=0;for(const t of this)++e;return e}function xh(){return!this.node()}function Ch(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,l;i<s;++i)(l=o[i])&&e.call(l,l.__data__,i,o);return this}function kh(e){return function(){this.removeAttribute(e)}}function Eh(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Sh(e,t){return function(){this.setAttribute(e,t)}}function Ph(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Mh(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Nh(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Oh(e,t){var n=Yo(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Eh:kh:typeof t=="function"?n.local?Nh:Mh:n.local?Ph:Sh)(n,t))}function pa(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Th(e){return function(){this.style.removeProperty(e)}}function Ah(e,t,n){return function(){this.style.setProperty(e,t,n)}}function zh(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Dh(e,t,n){return arguments.length>1?this.each((t==null?Th:typeof t=="function"?zh:Ah)(e,t,n??"")):cr(this.node(),e)}function cr(e,t){return e.style.getPropertyValue(t)||pa(e).getComputedStyle(e,null).getPropertyValue(t)}function Lh(e){return function(){delete this[e]}}function Ih(e,t){return function(){this[e]=t}}function Hh(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function $h(e,t){return arguments.length>1?this.each((t==null?Lh:typeof t=="function"?Hh:Ih)(e,t)):this.node()[e]}function wa(e){return e.trim().split(/^|\s+/)}function hs(e){return e.classList||new _a(e)}function _a(e){this._node=e,this._names=wa(e.getAttribute("class")||"")}_a.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ba(e,t){for(var n=hs(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function xa(e,t){for(var n=hs(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function Rh(e){return function(){ba(this,e)}}function Vh(e){return function(){xa(this,e)}}function Yh(e,t){return function(){(t.apply(this,arguments)?ba:xa)(this,e)}}function Bh(e,t){var n=wa(e+"");if(arguments.length<2){for(var r=hs(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?Yh:t?Rh:Vh)(n,t))}function Xh(){this.textContent=""}function Wh(e){return function(){this.textContent=e}}function Kh(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Fh(e){return arguments.length?this.each(e==null?Xh:(typeof e=="function"?Kh:Wh)(e)):this.node().textContent}function Zh(){this.innerHTML=""}function qh(e){return function(){this.innerHTML=e}}function Gh(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Uh(e){return arguments.length?this.each(e==null?Zh:(typeof e=="function"?Gh:qh)(e)):this.node().innerHTML}function jh(){this.nextSibling&&this.parentNode.appendChild(this)}function Jh(){return this.each(jh)}function Qh(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function eg(){return this.each(Qh)}function tg(e){var t=typeof e=="function"?e:ha(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function ng(){return null}function rg(e,t){var n=typeof e=="function"?e:ha(e),r=t==null?ng:typeof t=="function"?t:fs(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function og(){var e=this.parentNode;e&&e.removeChild(this)}function ig(){return this.each(og)}function sg(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function lg(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ag(e){return this.select(e?lg:sg)}function cg(e){return arguments.length?this.property("__data__",e):this.node().__data__}function ug(e){return function(t){e.call(this,t,this.__data__)}}function dg(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function fg(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function hg(e,t,n){return function(){var r=this.__on,o,i=ug(t);if(r){for(var s=0,l=r.length;s<l;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function gg(e,t,n){var r=dg(e+""),o,i=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,a=l.length,c;u<a;++u)for(o=0,c=l[u];o<i;++o)if((s=r[o]).type===c.type&&s.name===c.name)return c.value}return}for(l=t?hg:fg,o=0;o<i;++o)this.each(l(r[o],t,n));return this}function Ca(e,t,n){var r=pa(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function vg(e,t){return function(){return Ca(this,e,t)}}function yg(e,t){return function(){return Ca(this,e,t.apply(this,arguments))}}function mg(e,t){return this.each((typeof t=="function"?yg:vg)(e,t))}function*pg(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var ka=[null];function Et(e,t){this._groups=e,this._parents=t}function Br(){return new Et([[document.documentElement]],ka)}function wg(){return this}Et.prototype=Br.prototype={constructor:Et,select:Kf,selectAll:Gf,selectChild:Qf,selectChildren:rh,filter:oh,data:uh,enter:ih,exit:fh,join:hh,merge:gh,selection:wg,order:vh,sort:yh,call:ph,nodes:wh,node:_h,size:bh,empty:xh,each:Ch,attr:Oh,style:Dh,property:$h,classed:Bh,text:Fh,html:Uh,raise:Jh,lower:eg,append:tg,insert:rg,remove:ig,clone:ag,datum:cg,on:gg,dispatch:mg,[Symbol.iterator]:pg};function Ot(e){return typeof e=="string"?new Et([[document.querySelector(e)]],[document.documentElement]):new Et([[e]],ka)}function _g(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ht(e,t){if(e=_g(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const bg={passive:!1},Xr={capture:!0,passive:!1};function gs(e){e.stopImmediatePropagation()}function ur(e){e.preventDefault(),e.stopImmediatePropagation()}function Ea(e){var t=e.document.documentElement,n=Ot(e).on("dragstart.drag",ur,Xr);"onselectstart"in t?n.on("selectstart.drag",ur,Xr):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Sa(e,t){var n=e.document.documentElement,r=Ot(e).on("dragstart.drag",null);t&&(r.on("click.drag",ur,Xr),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Xo=e=>()=>e;function vs(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:l,dx:u,dy:a,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:a,enumerable:!0,configurable:!0},_:{value:c}})}vs.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function xg(e){return!e.ctrlKey&&!e.button}function Cg(){return this.parentNode}function kg(e,t){return t??{x:e.x,y:e.y}}function Eg(){return navigator.maxTouchPoints||"ontouchstart"in this}function Sg(){var e=xg,t=Cg,n=kg,r=Eg,o={},i=Ro("start","drag","end"),s=0,l,u,a,c,d=0;function f(S){S.on("mousedown.drag",h).filter(r).on("touchstart.drag",C).on("touchmove.drag",w,bg).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(S,x){if(!(c||!e.call(this,S,x))){var P=E(this,t.call(this,S,x),S,x,"mouse");P&&(Ot(S.view).on("mousemove.drag",y,Xr).on("mouseup.drag",_,Xr),Ea(S.view),gs(S),a=!1,l=S.clientX,u=S.clientY,P("start",S))}}function y(S){if(ur(S),!a){var x=S.clientX-l,P=S.clientY-u;a=x*x+P*P>d}o.mouse("drag",S)}function _(S){Ot(S.view).on("mousemove.drag mouseup.drag",null),Sa(S.view,a),ur(S),o.mouse("end",S)}function C(S,x){if(e.call(this,S,x)){var P=S.changedTouches,N=t.call(this,S,x),O=P.length,T,L;for(T=0;T<O;++T)(L=E(this,N,S,x,P[T].identifier,P[T]))&&(gs(S),L("start",S,P[T]))}}function w(S){var x=S.changedTouches,P=x.length,N,O;for(N=0;N<P;++N)(O=o[x[N].identifier])&&(ur(S),O("drag",S,x[N]))}function v(S){var x=S.changedTouches,P=x.length,N,O;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),N=0;N<P;++N)(O=o[x[N].identifier])&&(gs(S),O("end",S,x[N]))}function E(S,x,P,N,O,T){var L=i.copy(),V=Ht(T||P,x),$,H,k;if((k=n.call(S,new vs("beforestart",{sourceEvent:P,target:f,identifier:O,active:s,x:V[0],y:V[1],dx:0,dy:0,dispatch:L}),N))!=null)return $=k.x-V[0]||0,H=k.y-V[1]||0,function I(b,M,A){var D=V,Y;switch(b){case"start":o[O]=I,Y=s++;break;case"end":delete o[O],--s;case"drag":V=Ht(A||M,x),Y=s;break}L.call(b,S,new vs(b,{sourceEvent:M,subject:k,target:f,identifier:O,active:Y,x:V[0]+$,y:V[1]+H,dx:V[0]-D[0],dy:V[1]-D[1],dispatch:L}),N)}}return f.filter=function(S){return arguments.length?(e=typeof S=="function"?S:Xo(!!S),f):e},f.container=function(S){return arguments.length?(t=typeof S=="function"?S:Xo(S),f):t},f.subject=function(S){return arguments.length?(n=typeof S=="function"?S:Xo(S),f):n},f.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:Xo(!!S),f):r},f.on=function(){var S=i.on.apply(i,arguments);return S===i?f:S},f.clickDistance=function(S){return arguments.length?(d=(S=+S)*S,f):Math.sqrt(d)},f}function ys(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Pa(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Wr(){}var Kr=.7,Wo=1/Kr,dr="\\s*([+-]?\\d+)\\s*",Fr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",jt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Pg=/^#([0-9a-f]{3,8})$/,Mg=new RegExp(`^rgb\\(${dr},${dr},${dr}\\)$`),Ng=new RegExp(`^rgb\\(${jt},${jt},${jt}\\)$`),Og=new RegExp(`^rgba\\(${dr},${dr},${dr},${Fr}\\)$`),Tg=new RegExp(`^rgba\\(${jt},${jt},${jt},${Fr}\\)$`),Ag=new RegExp(`^hsl\\(${Fr},${jt},${jt}\\)$`),zg=new RegExp(`^hsla\\(${Fr},${jt},${jt},${Fr}\\)$`),Ma={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ys(Wr,Zr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Na,formatHex:Na,formatHex8:Dg,formatHsl:Lg,formatRgb:Oa,toString:Oa});function Na(){return this.rgb().formatHex()}function Dg(){return this.rgb().formatHex8()}function Lg(){return La(this).formatHsl()}function Oa(){return this.rgb().formatRgb()}function Zr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Pg.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ta(t):n===3?new wt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ko(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ko(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Mg.exec(e))?new wt(t[1],t[2],t[3],1):(t=Ng.exec(e))?new wt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Og.exec(e))?Ko(t[1],t[2],t[3],t[4]):(t=Tg.exec(e))?Ko(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ag.exec(e))?Da(t[1],t[2]/100,t[3]/100,1):(t=zg.exec(e))?Da(t[1],t[2]/100,t[3]/100,t[4]):Ma.hasOwnProperty(e)?Ta(Ma[e]):e==="transparent"?new wt(NaN,NaN,NaN,0):null}function Ta(e){return new wt(e>>16&255,e>>8&255,e&255,1)}function Ko(e,t,n,r){return r<=0&&(e=t=n=NaN),new wt(e,t,n,r)}function Ig(e){return e instanceof Wr||(e=Zr(e)),e?(e=e.rgb(),new wt(e.r,e.g,e.b,e.opacity)):new wt}function ms(e,t,n,r){return arguments.length===1?Ig(e):new wt(e,t,n,r??1)}function wt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ys(wt,ms,Pa(Wr,{brighter(e){return e=e==null?Wo:Math.pow(Wo,e),new wt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Kr:Math.pow(Kr,e),new wt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new wt(Hn(this.r),Hn(this.g),Hn(this.b),Fo(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Aa,formatHex:Aa,formatHex8:Hg,formatRgb:za,toString:za}));function Aa(){return`#${$n(this.r)}${$n(this.g)}${$n(this.b)}`}function Hg(){return`#${$n(this.r)}${$n(this.g)}${$n(this.b)}${$n((isNaN(this.opacity)?1:this.opacity)*255)}`}function za(){const e=Fo(this.opacity);return`${e===1?"rgb(":"rgba("}${Hn(this.r)}, ${Hn(this.g)}, ${Hn(this.b)}${e===1?")":`, ${e})`}`}function Fo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Hn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $n(e){return e=Hn(e),(e<16?"0":"")+e.toString(16)}function Da(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $t(e,t,n,r)}function La(e){if(e instanceof $t)return new $t(e.h,e.s,e.l,e.opacity);if(e instanceof Wr||(e=Zr(e)),!e)return new $t;if(e instanceof $t)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,l=i-o,u=(i+o)/2;return l?(t===i?s=(n-r)/l+(n<r)*6:n===i?s=(r-t)/l+2:s=(t-n)/l+4,l/=u<.5?i+o:2-i-o,s*=60):l=u>0&&u<1?0:s,new $t(s,l,u,e.opacity)}function $g(e,t,n,r){return arguments.length===1?La(e):new $t(e,t,n,r??1)}function $t(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ys($t,$g,Pa(Wr,{brighter(e){return e=e==null?Wo:Math.pow(Wo,e),new $t(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Kr:Math.pow(Kr,e),new $t(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new wt(ps(e>=240?e-240:e+120,o,r),ps(e,o,r),ps(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new $t(Ia(this.h),Zo(this.s),Zo(this.l),Fo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Fo(this.opacity);return`${e===1?"hsl(":"hsla("}${Ia(this.h)}, ${Zo(this.s)*100}%, ${Zo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ia(e){return e=(e||0)%360,e<0?e+360:e}function Zo(e){return Math.max(0,Math.min(1,e||0))}function ps(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ha=e=>()=>e;function Rg(e,t){return function(n){return e+n*t}}function Vg(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Yg(e){return(e=+e)==1?$a:function(t,n){return n-t?Vg(t,n,e):Ha(isNaN(t)?n:t)}}function $a(e,t){var n=t-e;return n?Rg(e,n):Ha(isNaN(e)?t:e)}const Ra=function e(t){var n=Yg(t);function r(o,i){var s=n((o=ms(o)).r,(i=ms(i)).r),l=n(o.g,i.g),u=n(o.b,i.b),a=$a(o.opacity,i.opacity);return function(c){return o.r=s(c),o.g=l(c),o.b=u(c),o.opacity=a(c),o+""}}return r.gamma=e,r}(1);function kn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var ws=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_s=new RegExp(ws.source,"g");function Bg(e){return function(){return e}}function Xg(e){return function(t){return e(t)+""}}function Wg(e,t){var n=ws.lastIndex=_s.lastIndex=0,r,o,i,s=-1,l=[],u=[];for(e=e+"",t=t+"";(r=ws.exec(e))&&(o=_s.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),l[s]?l[s]+=i:l[++s]=i),(r=r[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,u.push({i:s,x:kn(r,o)})),n=_s.lastIndex;return n<t.length&&(i=t.slice(n),l[s]?l[s]+=i:l[++s]=i),l.length<2?u[0]?Xg(u[0].x):Bg(t):(t=u.length,function(a){for(var c=0,d;c<t;++c)l[(d=u[c]).i]=d.x(a);return l.join("")})}var Va=180/Math.PI,bs={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ya(e,t,n,r,o,i){var s,l,u;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,u/=l),e*r<t*n&&(e=-e,t=-t,u=-u,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*Va,skewX:Math.atan(u)*Va,scaleX:s,scaleY:l}}var qo;function Kg(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?bs:Ya(t.a,t.b,t.c,t.d,t.e,t.f)}function Fg(e){return e==null||(qo||(qo=document.createElementNS("http://www.w3.org/2000/svg","g")),qo.setAttribute("transform",e),!(e=qo.transform.baseVal.consolidate()))?bs:(e=e.matrix,Ya(e.a,e.b,e.c,e.d,e.e,e.f))}function Ba(e,t,n,r){function o(a){return a.length?a.pop()+" ":""}function i(a,c,d,f,h,y){if(a!==d||c!==f){var _=h.push("translate(",null,t,null,n);y.push({i:_-4,x:kn(a,d)},{i:_-2,x:kn(c,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function s(a,c,d,f){a!==c?(a-c>180?c+=360:c-a>180&&(a+=360),f.push({i:d.push(o(d)+"rotate(",null,r)-2,x:kn(a,c)})):c&&d.push(o(d)+"rotate("+c+r)}function l(a,c,d,f){a!==c?f.push({i:d.push(o(d)+"skewX(",null,r)-2,x:kn(a,c)}):c&&d.push(o(d)+"skewX("+c+r)}function u(a,c,d,f,h,y){if(a!==d||c!==f){var _=h.push(o(h)+"scale(",null,",",null,")");y.push({i:_-4,x:kn(a,d)},{i:_-2,x:kn(c,f)})}else(d!==1||f!==1)&&h.push(o(h)+"scale("+d+","+f+")")}return function(a,c){var d=[],f=[];return a=e(a),c=e(c),i(a.translateX,a.translateY,c.translateX,c.translateY,d,f),s(a.rotate,c.rotate,d,f),l(a.skewX,c.skewX,d,f),u(a.scaleX,a.scaleY,c.scaleX,c.scaleY,d,f),a=c=null,function(h){for(var y=-1,_=f.length,C;++y<_;)d[(C=f[y]).i]=C.x(h);return d.join("")}}}var Zg=Ba(Kg,"px, ","px)","deg)"),qg=Ba(Fg,", ",")",")"),Gg=1e-12;function Xa(e){return((e=Math.exp(e))+1/e)/2}function Ug(e){return((e=Math.exp(e))-1/e)/2}function jg(e){return((e=Math.exp(2*e))-1)/(e+1)}const Jg=function e(t,n,r){function o(i,s){var l=i[0],u=i[1],a=i[2],c=s[0],d=s[1],f=s[2],h=c-l,y=d-u,_=h*h+y*y,C,w;if(_<Gg)w=Math.log(f/a)/t,C=function(N){return[l+N*h,u+N*y,a*Math.exp(t*N*w)]};else{var v=Math.sqrt(_),E=(f*f-a*a+r*_)/(2*a*n*v),S=(f*f-a*a-r*_)/(2*f*n*v),x=Math.log(Math.sqrt(E*E+1)-E),P=Math.log(Math.sqrt(S*S+1)-S);w=(P-x)/t,C=function(N){var O=N*w,T=Xa(x),L=a/(n*v)*(T*jg(t*O+x)-Ug(x));return[l+L*h,u+L*y,a*T/Xa(t*O+x)]}}return C.duration=w*1e3*t/Math.SQRT2,C}return o.rho=function(i){var s=Math.max(.001,+i),l=s*s,u=l*l;return e(s,l,u)},o}(Math.SQRT2,2,4);var fr=0,qr=0,Gr=0,Wa=1e3,Go,Ur,Uo=0,Rn=0,jo=0,jr=typeof performance=="object"&&performance.now?performance:Date,Ka=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function xs(){return Rn||(Ka(Qg),Rn=jr.now()+jo)}function Qg(){Rn=0}function Jo(){this._call=this._time=this._next=null}Jo.prototype=Fa.prototype={constructor:Jo,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?xs():+n)+(t==null?0:+t),!this._next&&Ur!==this&&(Ur?Ur._next=this:Go=this,Ur=this),this._call=e,this._time=n,Cs()},stop:function(){this._call&&(this._call=null,this._time=1/0,Cs())}};function Fa(e,t,n){var r=new Jo;return r.restart(e,t,n),r}function ev(){xs(),++fr;for(var e=Go,t;e;)(t=Rn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--fr}function Za(){Rn=(Uo=jr.now())+jo,fr=qr=0;try{ev()}finally{fr=0,nv(),Rn=0}}function tv(){var e=jr.now(),t=e-Uo;t>Wa&&(jo-=t,Uo=e)}function nv(){for(var e,t=Go,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Go=n);Ur=e,Cs(r)}function Cs(e){if(!fr){qr&&(qr=clearTimeout(qr));var t=e-Rn;t>24?(e<1/0&&(qr=setTimeout(Za,e-jr.now()-jo)),Gr&&(Gr=clearInterval(Gr))):(Gr||(Uo=jr.now(),Gr=setInterval(tv,Wa)),fr=1,Ka(Za))}}function qa(e,t,n){var r=new Jo;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var rv=Ro("start","end","cancel","interrupt"),ov=[],Ga=0,Ua=1,ks=2,Qo=3,ja=4,Es=5,ei=6;function ti(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;iv(e,n,{name:t,index:r,group:o,on:rv,tween:ov,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Ga})}function Ss(e,t){var n=Rt(e,t);if(n.state>Ga)throw new Error("too late; already scheduled");return n}function Jt(e,t){var n=Rt(e,t);if(n.state>Qo)throw new Error("too late; already running");return n}function Rt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function iv(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Fa(i,0,n.time);function i(a){n.state=Ua,n.timer.restart(s,n.delay,n.time),n.delay<=a&&s(a-n.delay)}function s(a){var c,d,f,h;if(n.state!==Ua)return u();for(c in r)if(h=r[c],h.name===n.name){if(h.state===Qo)return qa(s);h.state===ja?(h.state=ei,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=ei,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(qa(function(){n.state===Qo&&(n.state=ja,n.timer.restart(l,n.delay,n.time),l(a))}),n.state=ks,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ks){for(n.state=Qo,o=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=h);o.length=d+1}}function l(a){for(var c=a<n.duration?n.ease.call(null,a/n.duration):(n.timer.restart(u),n.state=Es,1),d=-1,f=o.length;++d<f;)o[d].call(e,c);n.state===Es&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=ei,n.timer.stop(),delete r[t];for(var a in r)return;delete e.__transition}}function ni(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>ks&&r.state<Es,r.state=ei,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function sv(e){return this.each(function(){ni(this,e)})}function lv(e,t){var n,r;return function(){var o=Jt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function av(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Jt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var l={name:t,value:n},u=0,a=o.length;u<a;++u)if(o[u].name===t){o[u]=l;break}u===a&&o.push(l)}i.tween=o}}function cv(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Rt(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?lv:av)(n,e,t))}function Ps(e,t,n){var r=e._id;return e.each(function(){var o=Jt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Rt(o,r).value[t]}}function Ja(e,t){var n;return(typeof t=="number"?kn:t instanceof Zr?Ra:(n=Zr(t))?(t=n,Ra):Wg)(e,t)}function uv(e){return function(){this.removeAttribute(e)}}function dv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fv(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function hv(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function gv(e,t,n){var r,o,i;return function(){var s,l=n(this),u;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=l+"",s===u?null:s===r&&u===o?i:(o=u,i=t(r=s,l)))}}function vv(e,t,n){var r,o,i;return function(){var s,l=n(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=l+"",s===u?null:s===r&&u===o?i:(o=u,i=t(r=s,l)))}}function yv(e,t){var n=Yo(e),r=n==="transform"?qg:Ja;return this.attrTween(e,typeof t=="function"?(n.local?vv:gv)(n,r,Ps(this,"attr."+e,t)):t==null?(n.local?dv:uv)(n):(n.local?hv:fv)(n,r,t))}function mv(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function pv(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function wv(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&pv(e,i)),n}return o._value=t,o}function _v(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&mv(e,i)),n}return o._value=t,o}function bv(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Yo(e);return this.tween(n,(r.local?wv:_v)(r,t))}function xv(e,t){return function(){Ss(this,e).delay=+t.apply(this,arguments)}}function Cv(e,t){return t=+t,function(){Ss(this,e).delay=t}}function kv(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?xv:Cv)(t,e)):Rt(this.node(),t).delay}function Ev(e,t){return function(){Jt(this,e).duration=+t.apply(this,arguments)}}function Sv(e,t){return t=+t,function(){Jt(this,e).duration=t}}function Pv(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Ev:Sv)(t,e)):Rt(this.node(),t).duration}function Mv(e,t){if(typeof t!="function")throw new Error;return function(){Jt(this,e).ease=t}}function Nv(e){var t=this._id;return arguments.length?this.each(Mv(t,e)):Rt(this.node(),t).ease}function Ov(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Jt(this,e).ease=n}}function Tv(e){if(typeof e!="function")throw new Error;return this.each(Ov(this._id,e))}function Av(e){typeof e!="function"&&(e=va(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],u,a=0;a<s;++a)(u=i[a])&&e.call(u,u.__data__,a,i)&&l.push(u);return new on(r,this._parents,this._name,this._id)}function zv(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),l=0;l<i;++l)for(var u=t[l],a=n[l],c=u.length,d=s[l]=new Array(c),f,h=0;h<c;++h)(f=u[h]||a[h])&&(d[h]=f);for(;l<r;++l)s[l]=t[l];return new on(s,this._parents,this._name,this._id)}function Dv(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Lv(e,t,n){var r,o,i=Dv(t)?Ss:Jt;return function(){var s=i(this,e),l=s.on;l!==r&&(o=(r=l).copy()).on(t,n),s.on=o}}function Iv(e,t){var n=this._id;return arguments.length<2?Rt(this.node(),n).on.on(e):this.each(Lv(n,e,t))}function Hv(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function $v(){return this.on("end.remove",Hv(this._id))}function Rv(e){var t=this._name,n=this._id;typeof e!="function"&&(e=fs(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var l=r[s],u=l.length,a=i[s]=new Array(u),c,d,f=0;f<u;++f)(c=l[f])&&(d=e.call(c,c.__data__,f,l))&&("__data__"in c&&(d.__data__=c.__data__),a[f]=d,ti(a[f],t,n,f,a,Rt(c,n)));return new on(i,this._parents,t,n)}function Vv(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ga(e));for(var r=this._groups,o=r.length,i=[],s=[],l=0;l<o;++l)for(var u=r[l],a=u.length,c,d=0;d<a;++d)if(c=u[d]){for(var f=e.call(c,c.__data__,d,u),h,y=Rt(c,n),_=0,C=f.length;_<C;++_)(h=f[_])&&ti(h,t,n,_,f,y);i.push(f),s.push(c)}return new on(i,s,t,n)}var Yv=Br.prototype.constructor;function Bv(){return new Yv(this._groups,this._parents)}function Xv(e,t){var n,r,o;return function(){var i=cr(this,e),s=(this.style.removeProperty(e),cr(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Qa(e){return function(){this.style.removeProperty(e)}}function Wv(e,t,n){var r,o=n+"",i;return function(){var s=cr(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function Kv(e,t,n){var r,o,i;return function(){var s=cr(this,e),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),cr(this,e))),s===u?null:s===r&&u===o?i:(o=u,i=t(r=s,l))}}function Fv(e,t){var n,r,o,i="style."+t,s="end."+i,l;return function(){var u=Jt(this,e),a=u.on,c=u.value[i]==null?l||(l=Qa(t)):void 0;(a!==n||o!==c)&&(r=(n=a).copy()).on(s,o=c),u.on=r}}function Zv(e,t,n){var r=(e+="")=="transform"?Zg:Ja;return t==null?this.styleTween(e,Xv(e,r)).on("end.style."+e,Qa(e)):typeof t=="function"?this.styleTween(e,Kv(e,r,Ps(this,"style."+e,t))).each(Fv(this._id,e)):this.styleTween(e,Wv(e,r,t),n).on("end.style."+e,null)}function qv(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Gv(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&qv(e,s,n)),r}return i._value=t,i}function Uv(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Gv(e,t,n??""))}function jv(e){return function(){this.textContent=e}}function Jv(e){return function(){var t=e(this);this.textContent=t??""}}function Qv(e){return this.tween("text",typeof e=="function"?Jv(Ps(this,"text",e)):jv(e==null?"":e+""))}function e0(e){return function(t){this.textContent=e.call(this,t)}}function t0(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&e0(o)),t}return r._value=e,r}function n0(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,t0(e))}function r0(){for(var e=this._name,t=this._id,n=ec(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,u,a=0;a<l;++a)if(u=s[a]){var c=Rt(u,t);ti(u,e,n,a,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new on(r,this._parents,e,n)}function o0(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var l={value:s},u={value:function(){--o===0&&i()}};n.each(function(){var a=Jt(this,r),c=a.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(u)),a.on=t}),o===0&&i()})}var i0=0;function on(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function ec(){return++i0}var sn=Br.prototype;on.prototype={constructor:on,select:Rv,selectAll:Vv,selectChild:sn.selectChild,selectChildren:sn.selectChildren,filter:Av,merge:zv,selection:Bv,transition:r0,call:sn.call,nodes:sn.nodes,node:sn.node,size:sn.size,empty:sn.empty,each:sn.each,on:Iv,attr:yv,attrTween:bv,style:Zv,styleTween:Uv,text:Qv,textTween:n0,remove:$v,tween:cv,delay:kv,duration:Pv,ease:Nv,easeVarying:Tv,end:o0,[Symbol.iterator]:sn[Symbol.iterator]};function s0(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var l0={time:null,delay:0,duration:250,ease:s0};function a0(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function c0(e){var t,n;e instanceof on?(t=e._id,e=e._name):(t=ec(),(n=l0).time=xs(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,u,a=0;a<l;++a)(u=s[a])&&ti(u,e,t,a,s,n||a0(u,t));return new on(r,this._parents,e,t)}Br.prototype.interrupt=sv,Br.prototype.transition=c0;const ri=e=>()=>e;function u0(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function ln(e,t,n){this.k=e,this.x=t,this.y=n}ln.prototype={constructor:ln,scale:function(e){return e===1?this:new ln(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ln(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var oi=new ln(1,0,0);tc.prototype=ln.prototype;function tc(e){for(;!e.__zoom;)if(!(e=e.parentNode))return oi;return e.__zoom}function Ms(e){e.stopImmediatePropagation()}function Jr(e){e.preventDefault(),e.stopImmediatePropagation()}function d0(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function f0(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function nc(){return this.__zoom||oi}function h0(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function g0(){return navigator.maxTouchPoints||"ontouchstart"in this}function v0(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function rc(){var e=d0,t=f0,n=v0,r=h0,o=g0,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,u=Jg,a=Ro("start","zoom","end"),c,d,f,h=500,y=150,_=0,C=10;function w(k){k.property("__zoom",nc).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",L).filter(o).on("touchstart.zoom",V).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(k,I,b,M){var A=k.selection?k.selection():k;A.property("__zoom",nc),k!==A?x(k,I,b,M):A.interrupt().each(function(){P(this,arguments).event(M).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},w.scaleBy=function(k,I,b,M){w.scaleTo(k,function(){var A=this.__zoom.k,D=typeof I=="function"?I.apply(this,arguments):I;return A*D},b,M)},w.scaleTo=function(k,I,b,M){w.transform(k,function(){var A=t.apply(this,arguments),D=this.__zoom,Y=b==null?S(A):typeof b=="function"?b.apply(this,arguments):b,Z=D.invert(Y),Q=typeof I=="function"?I.apply(this,arguments):I;return n(E(v(D,Q),Y,Z),A,s)},b,M)},w.translateBy=function(k,I,b,M){w.transform(k,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof b=="function"?b.apply(this,arguments):b),t.apply(this,arguments),s)},null,M)},w.translateTo=function(k,I,b,M,A){w.transform(k,function(){var D=t.apply(this,arguments),Y=this.__zoom,Z=M==null?S(D):typeof M=="function"?M.apply(this,arguments):M;return n(oi.translate(Z[0],Z[1]).scale(Y.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof b=="function"?-b.apply(this,arguments):-b),D,s)},M,A)};function v(k,I){return I=Math.max(i[0],Math.min(i[1],I)),I===k.k?k:new ln(I,k.x,k.y)}function E(k,I,b){var M=I[0]-b[0]*k.k,A=I[1]-b[1]*k.k;return M===k.x&&A===k.y?k:new ln(k.k,M,A)}function S(k){return[(+k[0][0]+ +k[1][0])/2,(+k[0][1]+ +k[1][1])/2]}function x(k,I,b,M){k.on("start.zoom",function(){P(this,arguments).event(M).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(M).end()}).tween("zoom",function(){var A=this,D=arguments,Y=P(A,D).event(M),Z=t.apply(A,D),Q=b==null?S(Z):typeof b=="function"?b.apply(A,D):b,G=Math.max(Z[1][0]-Z[0][0],Z[1][1]-Z[0][1]),F=A.__zoom,ne=typeof I=="function"?I.apply(A,D):I,fe=u(F.invert(Q).concat(G/F.k),ne.invert(Q).concat(G/ne.k));return function(re){if(re===1)re=ne;else{var Ee=fe(re),J=G/Ee[2];re=new ln(J,Q[0]-Ee[0]*J,Q[1]-Ee[1]*J)}Y.zoom(null,re)}})}function P(k,I,b){return!b&&k.__zooming||new N(k,I)}function N(k,I){this.that=k,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(k,I),this.taps=0}N.prototype={event:function(k){return k&&(this.sourceEvent=k),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(k,I){return this.mouse&&k!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&k!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&k!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(k){var I=Ot(this.that).datum();a.call(k,this.that,new u0(k,{sourceEvent:this.sourceEvent,target:w,type:k,transform:this.that.__zoom,dispatch:a}),I)}};function O(k,...I){if(!e.apply(this,arguments))return;var b=P(this,I).event(k),M=this.__zoom,A=Math.max(i[0],Math.min(i[1],M.k*Math.pow(2,r.apply(this,arguments)))),D=Ht(k);if(b.wheel)(b.mouse[0][0]!==D[0]||b.mouse[0][1]!==D[1])&&(b.mouse[1]=M.invert(b.mouse[0]=D)),clearTimeout(b.wheel);else{if(M.k===A)return;b.mouse=[D,M.invert(D)],ni(this),b.start()}Jr(k),b.wheel=setTimeout(Y,y),b.zoom("mouse",n(E(v(M,A),b.mouse[0],b.mouse[1]),b.extent,s));function Y(){b.wheel=null,b.end()}}function T(k,...I){if(f||!e.apply(this,arguments))return;var b=k.currentTarget,M=P(this,I,!0).event(k),A=Ot(k.view).on("mousemove.zoom",Q,!0).on("mouseup.zoom",G,!0),D=Ht(k,b),Y=k.clientX,Z=k.clientY;Ea(k.view),Ms(k),M.mouse=[D,this.__zoom.invert(D)],ni(this),M.start();function Q(F){if(Jr(F),!M.moved){var ne=F.clientX-Y,fe=F.clientY-Z;M.moved=ne*ne+fe*fe>_}M.event(F).zoom("mouse",n(E(M.that.__zoom,M.mouse[0]=Ht(F,b),M.mouse[1]),M.extent,s))}function G(F){A.on("mousemove.zoom mouseup.zoom",null),Sa(F.view,M.moved),Jr(F),M.event(F).end()}}function L(k,...I){if(e.apply(this,arguments)){var b=this.__zoom,M=Ht(k.changedTouches?k.changedTouches[0]:k,this),A=b.invert(M),D=b.k*(k.shiftKey?.5:2),Y=n(E(v(b,D),M,A),t.apply(this,I),s);Jr(k),l>0?Ot(this).transition().duration(l).call(x,Y,M,k):Ot(this).call(w.transform,Y,M,k)}}function V(k,...I){if(e.apply(this,arguments)){var b=k.touches,M=b.length,A=P(this,I,k.changedTouches.length===M).event(k),D,Y,Z,Q;for(Ms(k),Y=0;Y<M;++Y)Z=b[Y],Q=Ht(Z,this),Q=[Q,this.__zoom.invert(Q),Z.identifier],A.touch0?!A.touch1&&A.touch0[2]!==Q[2]&&(A.touch1=Q,A.taps=0):(A.touch0=Q,D=!0,A.taps=1+!!c);c&&(c=clearTimeout(c)),D&&(A.taps<2&&(d=Q[0],c=setTimeout(function(){c=null},h)),ni(this),A.start())}}function $(k,...I){if(this.__zooming){var b=P(this,I).event(k),M=k.changedTouches,A=M.length,D,Y,Z,Q;for(Jr(k),D=0;D<A;++D)Y=M[D],Z=Ht(Y,this),b.touch0&&b.touch0[2]===Y.identifier?b.touch0[0]=Z:b.touch1&&b.touch1[2]===Y.identifier&&(b.touch1[0]=Z);if(Y=b.that.__zoom,b.touch1){var G=b.touch0[0],F=b.touch0[1],ne=b.touch1[0],fe=b.touch1[1],re=(re=ne[0]-G[0])*re+(re=ne[1]-G[1])*re,Ee=(Ee=fe[0]-F[0])*Ee+(Ee=fe[1]-F[1])*Ee;Y=v(Y,Math.sqrt(re/Ee)),Z=[(G[0]+ne[0])/2,(G[1]+ne[1])/2],Q=[(F[0]+fe[0])/2,(F[1]+fe[1])/2]}else if(b.touch0)Z=b.touch0[0],Q=b.touch0[1];else return;b.zoom("touch",n(E(Y,Z,Q),b.extent,s))}}function H(k,...I){if(this.__zooming){var b=P(this,I).event(k),M=k.changedTouches,A=M.length,D,Y;for(Ms(k),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),D=0;D<A;++D)Y=M[D],b.touch0&&b.touch0[2]===Y.identifier?delete b.touch0:b.touch1&&b.touch1[2]===Y.identifier&&delete b.touch1;if(b.touch1&&!b.touch0&&(b.touch0=b.touch1,delete b.touch1),b.touch0)b.touch0[1]=this.__zoom.invert(b.touch0[0]);else if(b.end(),b.taps===2&&(Y=Ht(Y,this),Math.hypot(d[0]-Y[0],d[1]-Y[1])<C)){var Z=Ot(this).on("dblclick.zoom");Z&&Z.apply(this,arguments)}}}return w.wheelDelta=function(k){return arguments.length?(r=typeof k=="function"?k:ri(+k),w):r},w.filter=function(k){return arguments.length?(e=typeof k=="function"?k:ri(!!k),w):e},w.touchable=function(k){return arguments.length?(o=typeof k=="function"?k:ri(!!k),w):o},w.extent=function(k){return arguments.length?(t=typeof k=="function"?k:ri([[+k[0][0],+k[0][1]],[+k[1][0],+k[1][1]]]),w):t},w.scaleExtent=function(k){return arguments.length?(i[0]=+k[0],i[1]=+k[1],w):[i[0],i[1]]},w.translateExtent=function(k){return arguments.length?(s[0][0]=+k[0][0],s[1][0]=+k[1][0],s[0][1]=+k[0][1],s[1][1]=+k[1][1],w):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},w.constrain=function(k){return arguments.length?(n=k,w):n},w.duration=function(k){return arguments.length?(l=+k,w):l},w.interpolate=function(k){return arguments.length?(u=k,w):u},w.on=function(){var k=a.on.apply(a,arguments);return k===a?w:k},w.clickDistance=function(k){return arguments.length?(_=(k=+k)*k,w):Math.sqrt(_)},w.tapDistance=function(k){return arguments.length?(C=+k,w):C},w}const hr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`},ii=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]];var Vn;(function(e){e.Strict="strict",e.Loose="loose"})(Vn||(Vn={}));var En;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(En||(En={}));var si;(function(e){e.Partial="partial",e.Full="full"})(si||(si={}));const Ns={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var gr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(gr||(gr={}));var li;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(li||(li={}));var we;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(we||(we={}));const oc={[we.Left]:we.Right,[we.Right]:we.Left,[we.Top]:we.Bottom,[we.Bottom]:we.Top};function y0(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(const n of e.keys())if(!t.has(n))return!1;return!0}function ic(e,t,n){if(!n)return;const r=[];e.forEach((o,i)=>{t!=null&&t.has(i)||r.push(o)}),r.length&&n(r)}function m0(e){return e===null?null:e?"valid":"invalid"}const p0=e=>"id"in e&&"source"in e&&"target"in e,w0=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Os=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Qr=(e,t=[0,0])=>{const{width:n,height:r}=Sn(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},_0=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>{if(process.env.NODE_ENV==="development"&&!t.nodeLookup&&console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const i=typeof o=="string";let s=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(o):Os(o)?o:t.nodeLookup.get(o.id));const l=s?ui(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ai(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ci(n)},eo=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const o=ui(r);n=ai(n,o)}}),ci(n)},sc=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const l={...no(t,[n,r,o]),width:t.width/o,height:t.height/o},u=[];for(const a of e.values()){const{measured:c,selectable:d=!0,hidden:f=!1}=a;if(s&&!d||f)continue;const h=c.width??a.width??a.initialWidth??null,y=c.height??a.height??a.initialHeight??null,_=to(l,yr(a)),C=(h??0)*(y??0),w=i&&_>0;(!a.internals.handleBounds||w||_>=C||a.dragging)&&u.push(a)}return u},Ts=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function lc(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function ac({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return Promise.resolve(!1);const l=eo(e),u=Ds(l,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration}),Promise.resolve(!0)}function b0({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),l=s.parentId?n.get(s.parentId):void 0,{x:u,y:a}=l?l.internals.positionAbsolute:{x:0,y:0},c=s.origin??r;let d=o;if(s.extent==="parent"&&!s.expandParent)if(!l)i==null||i("005",hr.error005());else{const h=l.measured.width,y=l.measured.height;h&&y&&(d=[[u,a],[u+h,a+y]])}else l&&mr(s.extent)&&(d=[[s.extent[0][0]+u,s.extent[0][1]+a],[s.extent[1][0]+u,s.extent[1][1]+a]]);const f=mr(d)?Yn(t,d,s.measured):t;return{position:{x:f.x-u+s.measured.width*c[0],y:f.y-a+s.measured.height*c[1]},positionAbsolute:f}}async function cc({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const h=i.has(f.id),y=!h&&f.parentId&&s.find(_=>_.id===f.parentId);(h||y)&&s.push(f)}const l=new Set(t.map(f=>f.id)),u=r.filter(f=>f.deletable!==!1),c=Ts(s,u);for(const f of u)l.has(f.id)&&!c.find(y=>y.id===f.id)&&c.push(f);if(!o)return{edges:c,nodes:s};const d=await o({nodes:s,edges:c});return typeof d=="boolean"?d?{edges:c,nodes:s}:{edges:[],nodes:[]}:d}const vr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Yn=(e={x:0,y:0},t,n)=>({x:vr(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:vr(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function uc(e,t,n){const{width:r,height:o}=Sn(n),{x:i,y:s}=n.internals.positionAbsolute;return Yn(e,[[i,s],[i+r,s+o]],t)}const dc=(e,t,n)=>e<t?vr(Math.abs(e-t),1,t)/t:e>n?-vr(Math.abs(e-n),1,t)/t:0,fc=(e,t,n=15,r=40)=>{const o=dc(e.x,r,t.width-r)*n,i=dc(e.y,r,t.height-r)*n;return[o,i]},ai=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),As=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),ci=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),yr=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Os(e)?e.internals.positionAbsolute:Qr(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},ui=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Os(e)?e.internals.positionAbsolute:Qr(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},hc=(e,t)=>ci(ai(As(e),As(t))),to=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},gc=e=>an(e.width)&&an(e.height)&&an(e.x)&&an(e.y),an=e=>!isNaN(e)&&isFinite(e),vc=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},zs=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),no=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?zs(l,s):l},yc=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),Ds=(e,t,n,r,o,i)=>{const s=t/(e.width*(1+i)),l=n/(e.height*(1+i)),u=Math.min(s,l),a=vr(u,r,o),c=e.x+e.width/2,d=e.y+e.height/2,f=t/2-c*a,h=n/2-d*a;return{x:f,y:h,zoom:a}},di=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function mr(e){return e!==void 0&&e!=="parent"}function Sn(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function mc(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function x0(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const l=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function Ls(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=cn(e),l=no({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:u,y:a}=n?zs(l,t):l;return{xSnapped:u,ySnapped:a,...l}}const Is=e=>({width:e.offsetWidth,height:e.offsetHeight}),C0=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},k0=["INPUT","SELECT","TEXTAREA"];function E0(e){var r,o,i;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return k0.includes(t==null?void 0:t.nodeName)||((i=t==null?void 0:t.hasAttribute)==null?void 0:i.call(t,"contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const pc=e=>"clientX"in e,cn=(e,t)=>{var i,s;const n=pc(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},wc=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...Is(s)}})};function S0({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:l}){const u=e*.125+o*.375+s*.375+n*.125,a=t*.125+i*.375+l*.375+r*.125,c=Math.abs(u-e),d=Math.abs(a-t);return[u,a,c,d]}function fi(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function _c({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case we.Left:return[t-fi(t-r,i),n];case we.Right:return[t+fi(r-t,i),n];case we.Top:return[t,n-fi(n-o,i)];case we.Bottom:return[t,n+fi(o-n,i)]}}function bc({sourceX:e,sourceY:t,sourcePosition:n=we.Bottom,targetX:r,targetY:o,targetPosition:i=we.Top,curvature:s=.25}){const[l,u]=_c({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[a,c]=_c({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[d,f,h,y]=S0({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:u,targetControlX:a,targetControlY:c});return[`M${e},${t} C${l},${u} ${a},${c} ${r},${o}`,d,f,h,y]}function xc({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[i,l,o,s]}function P0({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1}){if(!o)return r;const i=n||t.selected||e.selected,s=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(i?s:0)}function M0({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=ai(ui(e),ui(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return to(s,ci(i))>0}const N0=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,O0=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),T0=(e,t)=>{if(!e.source||!e.target)return vc("006",hr.error006()),t;let n;return p0(e)?n={...e}:n={...e,id:N0(e)},O0(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function Hs({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,l]=xc({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,l]}const Cc={[we.Left]:{x:-1,y:0},[we.Right]:{x:1,y:0},[we.Top]:{x:0,y:-1},[we.Bottom]:{x:0,y:1}},A0=({source:e,sourcePosition:t=we.Bottom,target:n})=>t===we.Left||t===we.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},kc=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function z0({source:e,sourcePosition:t=we.Bottom,target:n,targetPosition:r=we.Top,center:o,offset:i}){const s=Cc[t],l=Cc[r],u={x:e.x+s.x*i,y:e.y+s.y*i},a={x:n.x+l.x*i,y:n.y+l.y*i},c=A0({source:u,sourcePosition:t,target:a}),d=c.x!==0?"x":"y",f=c[d];let h=[],y,_;const C={x:0,y:0},w={x:0,y:0},[v,E,S,x]=xc({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*l[d]===-1){y=o.x??v,_=o.y??E;const N=[{x:y,y:u.y},{x:y,y:a.y}],O=[{x:u.x,y:_},{x:a.x,y:_}];s[d]===f?h=d==="x"?N:O:h=d==="x"?O:N}else{const N=[{x:u.x,y:a.y}],O=[{x:a.x,y:u.y}];if(d==="x"?h=s.x===f?O:N:h=s.y===f?N:O,t===r){const H=Math.abs(e[d]-n[d]);if(H<=i){const k=Math.min(i-1,i-H);s[d]===f?C[d]=(u[d]>e[d]?-1:1)*k:w[d]=(a[d]>n[d]?-1:1)*k}}if(t!==r){const H=d==="x"?"y":"x",k=s[d]===l[H],I=u[H]>a[H],b=u[H]<a[H];(s[d]===1&&(!k&&I||k&&b)||s[d]!==1&&(!k&&b||k&&I))&&(h=d==="x"?N:O)}const T={x:u.x+C.x,y:u.y+C.y},L={x:a.x+w.x,y:a.y+w.y},V=Math.max(Math.abs(T.x-h[0].x),Math.abs(L.x-h[0].x)),$=Math.max(Math.abs(T.y-h[0].y),Math.abs(L.y-h[0].y));V>=$?(y=(T.x+L.x)/2,_=h[0].y):(y=h[0].x,_=(T.y+L.y)/2)}return[[e,{x:u.x+C.x,y:u.y+C.y},...h,{x:a.x+w.x,y:a.y+w.y},n],y,_,S,x]}function D0(e,t,n,r){const o=Math.min(kc(e,t)/2,kc(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const a=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+o*a},${s}Q ${i},${s} ${i},${s+o*c}`}const l=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${i},${s+o*u}Q ${i},${s} ${i+o*l},${s}`}function hi({sourceX:e,sourceY:t,sourcePosition:n=we.Bottom,targetX:r,targetY:o,targetPosition:i=we.Top,borderRadius:s=5,centerX:l,centerY:u,offset:a=20}){const[c,d,f,h,y]=z0({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:u},offset:a});return[c.reduce((C,w,v)=>{let E="";return v>0&&v<c.length-1?E=D0(c[v-1],w,c[v+1],s):E=`${v===0?"M":"L"}${w.x} ${w.y}`,C+=E,C},""),d,f,h,y]}function Ec(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function L0(e){var d;const{sourceNode:t,targetNode:n}=e;if(!Ec(t)||!Ec(n))return null;const r=t.internals.handleBounds||Sc(t.handles),o=n.internals.handleBounds||Sc(n.handles),i=Pc((r==null?void 0:r.source)??[],e.sourceHandle),s=Pc(e.connectionMode===Vn.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!s)return(d=e.onError)==null||d.call(e,"008",hr.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||we.Bottom,u=(s==null?void 0:s.position)||we.Top,a=ro(t,i,l),c=ro(n,s,u);return{sourceX:a.x,sourceY:a.y,targetX:c.x,targetY:c.y,sourcePosition:l,targetPosition:u}}function Sc(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function ro(e,t,n=we.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:l}=t??Sn(e);if(r)return{x:o+s/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case we.Top:return{x:o+s/2,y:i};case we.Right:return{x:o+s,y:i+l/2};case we.Bottom:return{x:o+s/2,y:i+l};case we.Left:return{x:o,y:i+l/2}}}function Pc(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function $s(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function I0(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,l)=>([l.markerStart||r,l.markerEnd||o].forEach(u=>{if(u&&typeof u=="object"){const a=$s(u,t);i.has(a)||(s.push({id:a,color:u.color||n,...u}),i.add(a))}}),s),[]).sort((s,l)=>s.id.localeCompare(l.id))}const Rs={nodeOrigin:[0,0],nodeExtent:ii,elevateNodesOnSelect:!0,defaults:{}},H0={...Rs,checkEquality:!0};function Vs(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function $0(e,t,n){const r=Vs(Rs,n);for(const o of e.values())if(o.parentId)Ys(o,e,t,r);else{const i=Qr(o,r.nodeOrigin),s=mr(o.extent)?o.extent:r.nodeExtent,l=Yn(i,s,Sn(o));o.internals.positionAbsolute=l}}function Mc(e,t,n,r){var l,u;const o=Vs(H0,r),i=new Map(t),s=o!=null&&o.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const a of e){let c=i.get(a.id);if(o.checkEquality&&a===(c==null?void 0:c.internals.userNode))t.set(a.id,c);else{const d=Qr(a,o.nodeOrigin),f=mr(a.extent)?a.extent:o.nodeExtent,h=Yn(d,f,Sn(a));c={...o.defaults,...a,measured:{width:(l=a.measured)==null?void 0:l.width,height:(u=a.measured)==null?void 0:u.height},internals:{positionAbsolute:h,handleBounds:a.measured?c==null?void 0:c.internals.handleBounds:void 0,z:Nc(a,s),userNode:a}},t.set(a.id,c)}a.parentId&&Ys(c,t,n,r)}}function R0(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Ys(e,t,n,r){const{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:s}=Vs(Rs,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}R0(e,n);const a=o?1e3:0,{x:c,y:d,z:f}=V0(e,u,i,s,a),{positionAbsolute:h}=e.internals,y=c!==h.x||d!==h.y;(y||f!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:y?{x:c,y:d}:h,z:f})}function Nc(e,t){return(an(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function V0(e,t,n,r,o){const{x:i,y:s}=t.internals.positionAbsolute,l=Sn(e),u=Qr(e,n),a=mr(e.extent)?Yn(u,e.extent,l):u;let c=Yn({x:i+a.x,y:s+a.y},r,l);e.extent==="parent"&&(c=uc(c,l,t));const d=Nc(e,o),f=t.internals.z??0;return{x:c.x,y:c.y,z:f>d?f:d}}function Y0(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const l of e){const u=t.get(l.parentId);if(!u)continue;const a=((s=i.get(l.parentId))==null?void 0:s.expandedRect)??yr(u),c=hc(a,l.rect);i.set(l.parentId,{expandedRect:c,parent:u})}return i.size>0&&i.forEach(({expandedRect:l,parent:u},a)=>{var E;const c=u.internals.positionAbsolute,d=Sn(u),f=u.origin??r,h=l.x<c.x?Math.round(Math.abs(c.x-l.x)):0,y=l.y<c.y?Math.round(Math.abs(c.y-l.y)):0,_=Math.max(d.width,Math.round(l.width)),C=Math.max(d.height,Math.round(l.height)),w=(_-d.width)*f[0],v=(C-d.height)*f[1];(h>0||y>0||w||v)&&(o.push({id:a,type:"position",position:{x:u.position.x-h+w,y:u.position.y-y+v}}),(E=n.get(a))==null||E.forEach(S=>{e.some(x=>x.id===S.id)||o.push({id:S.id,type:"position",position:{x:S.position.x+h,y:S.position.y+y}})})),(d.width<l.width||d.height<l.height||h||y)&&o.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:_+(h?f[0]*h-w:0),height:C+(y?f[1]*y-v:0)}})}),o}function B0(e,t,n,r,o,i){const s=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!s)return{changes:[],updatedInternals:l};const u=[],a=window.getComputedStyle(s),{m22:c}=new window.DOMMatrixReadOnly(a.transform),d=[];for(const f of e.values()){const h=t.get(f.id);if(h)if(h.hidden)h.internals={...h.internals,handleBounds:void 0},l=!0;else{const y=Is(f.nodeElement),_=h.measured.width!==y.width||h.measured.height!==y.height;if(!!(y.width&&y.height&&(_||!h.internals.handleBounds||f.force))){const w=f.nodeElement.getBoundingClientRect(),v=mr(h.extent)?h.extent:i;let{positionAbsolute:E}=h.internals;h.parentId&&h.extent==="parent"?E=uc(E,y,t.get(h.parentId)):v&&(E=Yn(E,v,y)),h.measured=y,h.internals={...h.internals,positionAbsolute:E,handleBounds:{source:wc("source",f.nodeElement,w,c,h.id),target:wc("target",f.nodeElement,w,c,h.id)}},h.parentId&&Ys(h,t,n,{nodeOrigin:o}),l=!0,_&&(u.push({id:h.id,type:"dimensions",dimensions:y}),h.expandParent&&h.parentId&&d.push({id:h.id,parentId:h.parentId,rect:yr(h,o)}))}}}if(d.length>0){const f=Y0(d,t,n,o);u.push(...f)}return{changes:u,updatedInternals:l}}async function X0({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r),l=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(l)}function Oc(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:l=null}=r,u=`${o}-source-${s}`,a=`${i}-target-${l}`,c=e.get(u)||new Map,d=e.get(a)||new Map,f={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:l};t.set(r.id,r),e.set(u,c.set(`${i}-${l}`,f)),e.set(a,d.set(`${o}-${s}`,f))}}function Tc(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Tc(n,t):!1}function Ac(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n)return!1;r=r.parentElement}while(r);return!1}function W0(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!Tc(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const l=e.get(i);l&&o.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return o}function Bs({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,u;const o=[];for(const[a,c]of t){const d=(s=n.get(a))==null?void 0:s.internals.userNode;d&&o.push({...d,position:c.position,dragging:r})}if(!e)return[o[0],o];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((u=t.get(e))==null?void 0:u.position)||i.position,dragging:r}:o[0],o]}function K0({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,l=new Map,u=!1,a={x:0,y:0},c=null,d=!1,f=null,h=!1;function y({noDragClassName:C,handleSelector:w,domNode:v,isSelectable:E,nodeId:S,nodeClickDistance:x=0}){f=Ot(v);function P({x:L,y:V},$){const{nodeLookup:H,nodeExtent:k,snapGrid:I,snapToGrid:b,nodeOrigin:M,onNodeDrag:A,onSelectionDrag:D,onError:Y,updateNodePositions:Z}=t();i={x:L,y:V};let Q=!1,G={x:0,y:0,x2:0,y2:0};if(l.size>1&&k){const F=eo(l);G=As(F)}for(const[F,ne]of l){if(!H.has(F))continue;let fe={x:L-ne.distance.x,y:V-ne.distance.y};b&&(fe=zs(fe,I));let re=[[k[0][0],k[0][1]],[k[1][0],k[1][1]]];if(l.size>1&&k&&!ne.extent){const{positionAbsolute:te}=ne.internals,he=te.x-G.x+k[0][0],_e=te.x+ne.measured.width-G.x2+k[1][0],Xe=te.y-G.y+k[0][1],q=te.y+ne.measured.height-G.y2+k[1][1];re=[[he,Xe],[_e,q]]}const{position:Ee,positionAbsolute:J}=b0({nodeId:F,nextPosition:fe,nodeLookup:H,nodeExtent:re,nodeOrigin:M,onError:Y});Q=Q||ne.position.x!==Ee.x||ne.position.y!==Ee.y,ne.position=Ee,ne.internals.positionAbsolute=J}if(Q&&(Z(l,!0),$&&(r||A||!S&&D))){const[F,ne]=Bs({nodeId:S,dragItems:l,nodeLookup:H});r==null||r($,l,F,ne),A==null||A($,F,ne),S||D==null||D($,ne)}}async function N(){if(!c)return;const{transform:L,panBy:V,autoPanSpeed:$}=t(),[H,k]=fc(a,c,$);(H!==0||k!==0)&&(i.x=(i.x??0)-H/L[2],i.y=(i.y??0)-k/L[2],await V({x:H,y:k})&&P(i,null)),s=requestAnimationFrame(N)}function O(L){var Q;const{nodeLookup:V,multiSelectionActive:$,nodesDraggable:H,transform:k,snapGrid:I,snapToGrid:b,selectNodesOnDrag:M,onNodeDragStart:A,onSelectionDragStart:D,unselectNodesAndEdges:Y}=t();d=!0,(!M||!E)&&!$&&S&&((Q=V.get(S))!=null&&Q.selected||Y()),E&&M&&S&&(e==null||e(S));const Z=Ls(L.sourceEvent,{transform:k,snapGrid:I,snapToGrid:b,containerBounds:c});if(i=Z,l=W0(V,H,Z,S),l.size>0&&(n||A||!S&&D)){const[G,F]=Bs({nodeId:S,dragItems:l,nodeLookup:V});n==null||n(L.sourceEvent,l,G,F),A==null||A(L.sourceEvent,G,F),S||D==null||D(L.sourceEvent,F)}}const T=Sg().clickDistance(x).on("start",L=>{const{domNode:V,nodeDragThreshold:$,transform:H,snapGrid:k,snapToGrid:I}=t();c=(V==null?void 0:V.getBoundingClientRect())||null,h=!1,$===0&&O(L),i=Ls(L.sourceEvent,{transform:H,snapGrid:k,snapToGrid:I,containerBounds:c}),a=cn(L.sourceEvent,c)}).on("drag",L=>{const{autoPanOnNodeDrag:V,transform:$,snapGrid:H,snapToGrid:k,nodeDragThreshold:I,nodeLookup:b}=t(),M=Ls(L.sourceEvent,{transform:$,snapGrid:H,snapToGrid:k,containerBounds:c});if((L.sourceEvent.type==="touchmove"&&L.sourceEvent.touches.length>1||S&&!b.has(S))&&(h=!0),!h){if(!u&&V&&d&&(u=!0,N()),!d){const A=M.xSnapped-(i.x??0),D=M.ySnapped-(i.y??0);Math.sqrt(A*A+D*D)>I&&O(L)}(i.x!==M.xSnapped||i.y!==M.ySnapped)&&l&&d&&(a=cn(L.sourceEvent,c),P(M,L.sourceEvent))}}).on("end",L=>{if(!(!d||h)&&(u=!1,d=!1,cancelAnimationFrame(s),l.size>0)){const{nodeLookup:V,updateNodePositions:$,onNodeDragStop:H,onSelectionDragStop:k}=t();if($(l,!1),o||H||!S&&k){const[I,b]=Bs({nodeId:S,dragItems:l,nodeLookup:V,dragging:!1});o==null||o(L.sourceEvent,l,I,b),H==null||H(L.sourceEvent,I,b),S||k==null||k(L.sourceEvent,b)}}}).filter(L=>{const V=L.target;return!L.button&&(!C||!Ac(V,`.${C}`,v))&&(!w||Ac(V,w,v))});f.call(T)}function _(){f==null||f.on(".drag",null)}return{update:y,destroy:_}}function F0(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())to(o,yr(i))>0&&r.push(i);return r}const Z0=250;function q0(e,t,n,r){var l,u;let o=[],i=1/0;const s=F0(e,n,t+Z0);for(const a of s){const c=[...((l=a.internals.handleBounds)==null?void 0:l.source)??[],...((u=a.internals.handleBounds)==null?void 0:u.target)??[]];for(const d of c){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:h}=ro(a,d,d.position,!0),y=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(h-e.y,2));y>t||(y<i?(o=[{...d,x:f,y:h}],i=y):y===i&&o.push({...d,x:f,y:h}))}}if(!o.length)return null;if(o.length>1){const a=r.type==="source"?"target":"source";return o.find(c=>c.type===a)??o[0]}return o[0]}function zc(e,t,n,r,o,i=!1){var a,c,d;const s=r.get(e);if(!s)return null;const l=o==="strict"?(a=s.internals.handleBounds)==null?void 0:a[t]:[...((c=s.internals.handleBounds)==null?void 0:c.source)??[],...((d=s.internals.handleBounds)==null?void 0:d.target)??[]],u=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return u&&i?{...u,...ro(s,u,u.position,!0)}:u}function Dc(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function G0(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Lc=()=>!0;function U0(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:l,nodeLookup:u,lib:a,autoPanOnConnect:c,flowId:d,panBy:f,cancelConnection:h,onConnectStart:y,onConnect:_,onConnectEnd:C,isValidConnection:w=Lc,onReconnectEnd:v,updateConnection:E,getTransform:S,getFromHandle:x,autoPanSpeed:P}){const N=C0(e.target);let O=0,T;const{x:L,y:V}=cn(e),$=N==null?void 0:N.elementFromPoint(L,V),H=Dc(i,$),k=l==null?void 0:l.getBoundingClientRect();if(!k||!H)return;const I=zc(o,H,r,u,t);if(!I)return;let b=cn(e,k),M=!1,A=null,D=!1,Y=null;function Z(){if(!c||!k)return;const[J,te]=fc(b,k,P);f({x:J,y:te}),O=requestAnimationFrame(Z)}const Q={...I,nodeId:o,type:H,position:I.position},G=u.get(o),ne={inProgress:!0,isValid:null,from:ro(G,Q,we.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:G,to:b,toHandle:null,toPosition:oc[Q.position],toNode:null};E(ne);let fe=ne;y==null||y(e,{nodeId:o,handleId:r,handleType:H});function re(J){if(!x()||!Q){Ee(J);return}const te=S();b=cn(J,k),T=q0(no(b,te,!1,[1,1]),n,u,Q),M||(Z(),M=!0);const he=Ic(J,{handle:T,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:w,doc:N,lib:a,flowId:d,nodeLookup:u});Y=he.handleDomNode,A=he.connection,D=G0(!!T,he.isValid);const _e={...fe,isValid:D,to:T&&D?yc({x:T.x,y:T.y},te):b,toHandle:he.toHandle,toPosition:D&&he.toHandle?he.toHandle.position:oc[Q.position],toNode:he.toHandle?u.get(he.toHandle.nodeId):null};D&&T&&fe.toHandle&&_e.toHandle&&fe.toHandle.type===_e.toHandle.type&&fe.toHandle.nodeId===_e.toHandle.nodeId&&fe.toHandle.id===_e.toHandle.id&&fe.to.x===_e.to.x&&fe.to.y===_e.to.y||(E(_e),fe=_e)}function Ee(J){(T||Y)&&A&&D&&(_==null||_(A));const{inProgress:te,...he}=fe,_e={...he,toPosition:fe.toHandle?fe.toPosition:null};C==null||C(J,_e),i&&(v==null||v(J,_e)),h(),cancelAnimationFrame(O),M=!1,D=!1,A=null,Y=null,N.removeEventListener("mousemove",re),N.removeEventListener("mouseup",Ee),N.removeEventListener("touchmove",re),N.removeEventListener("touchend",Ee)}N.addEventListener("mousemove",re),N.addEventListener("mouseup",Ee),N.addEventListener("touchmove",re),N.addEventListener("touchend",Ee)}function Ic(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:l,flowId:u,isValidConnection:a=Lc,nodeLookup:c}){const d=i==="target",f=t?s.querySelector(`.${l}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y}=cn(e),_=s.elementFromPoint(h,y),C=_!=null&&_.classList.contains(`${l}-flow__handle`)?_:f,w={handleDomNode:C,isValid:!1,connection:null,toHandle:null};if(C){const v=Dc(void 0,C),E=C.getAttribute("data-nodeid"),S=C.getAttribute("data-handleid"),x=C.classList.contains("connectable"),P=C.classList.contains("connectableend");if(!E||!v)return w;const N={source:d?E:r,sourceHandle:d?S:o,target:d?r:E,targetHandle:d?o:S};w.connection=N;const T=x&&P&&(n===Vn.Strict?d&&v==="source"||!d&&v==="target":E!==r||S!==o);w.isValid=T&&a(N),w.toHandle=zc(E,v,S,c,n,!1)}return w}const j0={onPointerDown:U0,isValid:Ic};function J0({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=Ot(e);function i({translateExtent:l,width:u,height:a,zoomStep:c=10,pannable:d=!0,zoomable:f=!0,inversePan:h=!1}){const y=E=>{const S=n();if(E.sourceEvent.type!=="wheel"||!t)return;const x=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*c,P=S[2]*Math.pow(2,x);t.scaleTo(P)};let _=[0,0];const C=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(_=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},w=E=>{const S=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!t)return;const x=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],P=[x[0]-_[0],x[1]-_[1]];_=x;const N=r()*Math.max(S[2],Math.log(S[2]))*(h?-1:1),O={x:S[0]-P[0]*N,y:S[1]-P[1]*N},T=[[0,0],[u,a]];t.setViewportConstrained({x:O.x,y:O.y,zoom:S[2]},T,l)},v=rc().on("start",C).on("zoom",d?w:null).on("zoom.wheel",f?y:null);o.call(v,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:Ht}}const Q0=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,gi=e=>({x:e.x,y:e.y,zoom:e.k}),Xs=({x:e,y:t,zoom:n})=>oi.translate(e,t).scale(n),pr=(e,t)=>e.target.closest(`.${t}`),Hc=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Ws=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},$c=e=>{const t=e.ctrlKey&&di()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function e1({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:a}){return c=>{if(pr(c,t))return!1;c.preventDefault(),c.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(c.ctrlKey&&s){const C=Ht(c),w=$c(c),v=d*Math.pow(2,w);r.scaleTo(n,v,C,c);return}const f=c.deltaMode===1?20:1;let h=o===En.Vertical?0:c.deltaX*f,y=o===En.Horizontal?0:c.deltaY*f;!di()&&c.shiftKey&&o!==En.Vertical&&(h=c.deltaY*f,y=0),r.translateBy(n,-(h/d)*i,-(y/d)*i,{internal:!0});const _=gi(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(c,_)),e.isPanScrolling&&(u==null||u(c,_),e.panScrollTimeout=setTimeout(()=>{a==null||a(c,_),e.isPanScrolling=!1},150))}}function t1({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){if(!t&&r.type==="wheel"&&!r.ctrlKey||pr(r,e))return null;r.preventDefault(),n.call(this,r,o)}}function n1({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,l;if((i=r.sourceEvent)!=null&&i.internal)return;const o=gi(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function r1({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,l;e.usedRightMouseButton=!!(n&&Hc(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((l=i.sourceEvent)!=null&&l.internal)&&(o==null||o(i.sourceEvent,gi(i.transform)))}}function o1({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{var l;if(!((l=s.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&Hc(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o&&Q0(e.prevViewport,s.transform))){const u=gi(s.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,u)},n?150:0)}}}function i1({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:l,noPanClassName:u,lib:a}){return c=>{var y;const d=e||t,f=n&&c.ctrlKey;if(c.button===1&&c.type==="mousedown"&&(pr(c,`${a}-flow__node`)||pr(c,`${a}-flow__edge`)))return!0;if(!r&&!d&&!o&&!i&&!n||s||pr(c,l)&&c.type==="wheel"||pr(c,u)&&(c.type!=="wheel"||o&&c.type==="wheel"&&!e)||!n&&c.ctrlKey&&c.type==="wheel")return!1;if(!n&&c.type==="touchstart"&&((y=c.touches)==null?void 0:y.length)>1)return c.preventDefault(),!1;if(!d&&!o&&!f&&c.type==="wheel"||!r&&(c.type==="mousedown"||c.type==="touchstart")||Array.isArray(r)&&!r.includes(c.button)&&c.type==="mousedown")return!1;const h=Array.isArray(r)&&r.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||c.type==="wheel")&&h}}function s1({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:o,viewport:i,onPanZoom:s,onPanZoomStart:l,onPanZoomEnd:u,onDraggingChange:a}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=rc().clickDistance(!an(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(o),h=Ot(e).call(f);E({x:i.x,y:i.y,zoom:vr(i.zoom,t,n)},[[0,0],[d.width,d.height]],o);const y=h.on("wheel.zoom"),_=h.on("dblclick.zoom");f.wheelDelta($c);function C($,H){return h?new Promise(k=>{f==null||f.transform(Ws(h,H==null?void 0:H.duration,()=>k(!0)),$)}):Promise.resolve(!1)}function w({noWheelClassName:$,noPanClassName:H,onPaneContextMenu:k,userSelectionActive:I,panOnScroll:b,panOnDrag:M,panOnScrollMode:A,panOnScrollSpeed:D,preventScrolling:Y,zoomOnPinch:Z,zoomOnScroll:Q,zoomOnDoubleClick:G,zoomActivationKeyPressed:F,lib:ne,onTransformChange:fe}){I&&!c.isZoomingOrPanning&&v();const Ee=b&&!F&&!I?e1({zoomPanValues:c,noWheelClassName:$,d3Selection:h,d3Zoom:f,panOnScrollMode:A,panOnScrollSpeed:D,zoomOnPinch:Z,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:u}):t1({noWheelClassName:$,preventScrolling:Y,d3ZoomHandler:y});if(h.on("wheel.zoom",Ee,{passive:!1}),!I){const te=n1({zoomPanValues:c,onDraggingChange:a,onPanZoomStart:l});f.on("start",te);const he=r1({zoomPanValues:c,panOnDrag:M,onPaneContextMenu:!!k,onPanZoom:s,onTransformChange:fe});f.on("zoom",he);const _e=o1({zoomPanValues:c,panOnDrag:M,panOnScroll:b,onPaneContextMenu:k,onPanZoomEnd:u,onDraggingChange:a});f.on("end",_e)}const J=i1({zoomActivationKeyPressed:F,panOnDrag:M,zoomOnScroll:Q,panOnScroll:b,zoomOnDoubleClick:G,zoomOnPinch:Z,userSelectionActive:I,noPanClassName:H,noWheelClassName:$,lib:ne});f.filter(J),G?h.on("dblclick.zoom",_):h.on("dblclick.zoom",null)}function v(){f.on("zoom",null)}async function E($,H,k){const I=Xs($),b=f==null?void 0:f.constrain()(I,H,k);return b&&await C(b),new Promise(M=>M(b))}async function S($,H){const k=Xs($);return await C(k,H),new Promise(I=>I(k))}function x($){if(h){const H=Xs($),k=h.property("__zoom");(k.k!==$.zoom||k.x!==$.x||k.y!==$.y)&&(f==null||f.transform(h,H,null,{sync:!0}))}}function P(){const $=h?tc(h.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function N($,H){return h?new Promise(k=>{f==null||f.scaleTo(Ws(h,H==null?void 0:H.duration,()=>k(!0)),$)}):Promise.resolve(!1)}function O($,H){return h?new Promise(k=>{f==null||f.scaleBy(Ws(h,H==null?void 0:H.duration,()=>k(!0)),$)}):Promise.resolve(!1)}function T($){f==null||f.scaleExtent($)}function L($){f==null||f.translateExtent($)}function V($){const H=!an($)||$<0?0:$;f==null||f.clickDistance(H)}return{update:w,destroy:v,setViewport:S,setViewportConstrained:E,getViewport:P,scaleTo:N,scaleBy:O,setScaleExtent:T,setTranslateExtent:L,syncViewport:x,setClickDistance:V}}var Rc;(function(e){e.Line="line",e.Handle="handle"})(Rc||(Rc={}));var l1=ve('<div role="button" tabindex="-1"><!></div>');function Bn(e,t){ue(t,!1);const n=ot(),r=()=>U(Q,"$connectable",n),o=()=>U(re,"$connectionRadius",n),i=()=>U(ne,"$domNode",n),s=()=>U(fe,"$nodeLookup",n),l=()=>U(F,"$connectionMode",n),u=()=>U(te,"$lib",n),a=()=>U(Ae,"$autoPanOnConnect",n),c=()=>U(Ze,"$flowId",n),d=()=>U(J,"$isValidConnectionStore",n),f=()=>U(_e,"$onedgecreate",n),h=()=>U(Fe,"$onConnectAction",n),y=()=>U(W,"$onConnectStartAction",n),_=()=>U(Ce,"$onConnectEndAction",n),C=()=>U(Ee,"$viewport",n),w=()=>U(ft,"$connection",n),v=()=>U(Ge,"$edges",n),E=()=>U(He,"$connectionLookup",n),S=j(),x=j(),P=j(),N=j(),O=j(),T=j(),L=j(),V=j();let $=p(t,"id",12,void 0),H=p(t,"type",12,"source"),k=p(t,"position",28,()=>we.Top),I=p(t,"style",12,void 0),b=p(t,"isValidConnection",12,void 0),M=p(t,"onconnect",12,void 0),A=p(t,"ondisconnect",12,void 0),D=p(t,"isConnectable",12,void 0),Y=p(t,"class",12,void 0);const Z=To("svelteflow__node_id"),Q=To("svelteflow__node_connectable"),G=Je(),{connectionMode:F,domNode:ne,nodeLookup:fe,connectionRadius:re,viewport:Ee,isValidConnection:J,lib:te,addEdge:he,onedgecreate:_e,panBy:Xe,cancelConnection:q,updateConnection:Ye,autoPanOnConnect:Ae,edges:Ge,connectionLookup:He,onconnect:Fe,onconnectstart:W,onconnectend:Ce,flowId:Ze,connection:ft}=G;function ze(be){const tt=pc(be);(tt&&be.button===0||!tt)&&j0.onPointerDown(be,{handleId:g(P),nodeId:Z,isTarget:g(S),connectionRadius:o(),domNode:i(),nodeLookup:s(),connectionMode:l(),lib:u(),autoPanOnConnect:a(),flowId:c(),isValidConnection:b()??d(),updateConnection:Ye,cancelConnection:q,panBy:Xe,onConnect:Oe=>{var _t;const rt=f()?f()(Oe):Oe;rt&&(he(rt),(_t=h())==null||_t(Oe))},onConnectStart:(Oe,rt)=>{var _t;(_t=y())==null||_t(Oe,{nodeId:rt.nodeId,handleId:rt.handleId,handleType:rt.handleType})},onConnectEnd:(Oe,rt)=>{var _t;(_t=_())==null||_t(Oe,rt)},getTransform:()=>[C().x,C().y,C().zoom],getFromHandle:()=>w().fromHandle})}let Qe=j(null),ie=j();oe(()=>B(H()),()=>{X(S,H()==="target")}),oe(()=>(B(D()),r()),()=>{X(x,D()!==void 0?D():r())}),oe(()=>B($()),()=>{X(P,$()||null)}),oe(()=>(B(M()),B(A()),v(),E(),B(H()),B($())),()=>{(M()||A())&&(v(),X(ie,E().get(`${Z}-${H()}-${$()||null}`)))}),oe(()=>(g(Qe),g(ie),B(A()),B(M())),()=>{if(g(Qe)&&!y0(g(ie),g(Qe))){const be=g(ie)??new Map;ic(g(Qe),be,A()),ic(be,g(Qe),M())}X(Qe,g(ie)??new Map)}),oe(()=>w(),()=>{X(N,!!w().fromHandle)}),oe(()=>(w(),B(H()),g(P)),()=>{var be,tt,Oe;X(O,((be=w().fromHandle)==null?void 0:be.nodeId)===Z&&((tt=w().fromHandle)==null?void 0:tt.type)===H()&&((Oe=w().fromHandle)==null?void 0:Oe.id)===g(P))}),oe(()=>(w(),B(H()),g(P)),()=>{var be,tt,Oe;X(T,((be=w().toHandle)==null?void 0:be.nodeId)===Z&&((tt=w().toHandle)==null?void 0:tt.type)===H()&&((Oe=w().toHandle)==null?void 0:Oe.id)===g(P))}),oe(()=>(l(),w(),B(H()),g(P)),()=>{var be,tt,Oe;X(L,l()===Vn.Strict?((be=w().fromHandle)==null?void 0:be.type)!==H():Z!==((tt=w().fromHandle)==null?void 0:tt.nodeId)||g(P)!==((Oe=w().fromHandle)==null?void 0:Oe.id))}),oe(()=>(g(T),w()),()=>{X(V,g(T)&&w().isValid)}),st(),me();var De=l1();ee(De,"data-nodeid",Z);const fn=ce(()=>Gt(dt(["svelte-flow__handle",`svelte-flow__handle-${k()}`,"nodrag","nopan",k(),Y()])));var On=ge(De);return et(On,t,"default",{},null),ae(De),pe(()=>{ee(De,"data-handleid",g(P)),ee(De,"data-handlepos",k()),ee(De,"data-id",`${c()??""}-${Z??""}-${($()||null)??""}-${H()??""}`),or(De,g(fn),""),ee(De,"style",I()),qe(De,"valid",g(V)),qe(De,"connectingto",g(T)),qe(De,"connectingfrom",g(O)),qe(De,"source",!g(S)),qe(De,"target",g(S)),qe(De,"connectablestart",g(x)),qe(De,"connectableend",g(x)),qe(De,"connectable",g(x)),qe(De,"connectionindicator",g(x)&&(!g(N)||g(L)))}),Be("mousedown",De,ze),Be("touchstart",De,ze),K(e,De),de({get id(){return $()},set id(be){$(be),m()},get type(){return H()},set type(be){H(be),m()},get position(){return k()},set position(be){k(be),m()},get style(){return I()},set style(be){I(be),m()},get isValidConnection(){return b()},set isValidConnection(be){b(be),m()},get onconnect(){return M()},set onconnect(be){M(be),m()},get ondisconnect(){return A()},set ondisconnect(be){A(be),m()},get isConnectable(){return D()},set isConnectable(be){D(be),m()},get class(){return Y()},set class(be){Y(be),m()}})}se(Bn,{id:{},type:{},position:{},style:{},isValidConnection:{},onconnect:{},ondisconnect:{},isConnectable:{},class:{}},["default"],[],!0);var a1=ve("<!> <!>",1);function vi(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]);Se(n,["data","targetPosition","sourcePosition"]),ue(t,!1);let r=p(t,"data",28,()=>({label:"Node"})),o=p(t,"targetPosition",12,void 0),i=p(t,"sourcePosition",12,void 0);me();var s=a1(),l=$e(s),u=ce(()=>o()??we.Top);Bn(l,{type:"target",get position(){return g(u)}});var a=ye(l),c=ye(a),d=ce(()=>i()??we.Bottom);return Bn(c,{type:"source",get position(){return g(d)}}),pe(()=>{var f;return bn(a,` ${((f=r())==null?void 0:f.label)??""} `)}),K(e,s),de({get data(){return r()},set data(f){r(f),m()},get targetPosition(){return o()},set targetPosition(f){o(f),m()},get sourcePosition(){return i()},set sourcePosition(f){i(f),m()}})}se(vi,{data:{},targetPosition:{},sourcePosition:{}},[],[],!0);var c1=ve(" <!>",1);function Vc(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]);Se(n,["data","sourcePosition"]),ue(t,!1);let r=p(t,"data",28,()=>({label:"Node"})),o=p(t,"sourcePosition",12,void 0);me(),zr();var i=c1(),s=$e(i),l=ye(s),u=ce(()=>o()??we.Bottom);return Bn(l,{type:"source",get position(){return g(u)}}),pe(()=>{var a;return bn(s,`${((a=r())==null?void 0:a.label)??""} `)}),K(e,i),de({get data(){return r()},set data(a){r(a),m()},get sourcePosition(){return o()},set sourcePosition(a){o(a),m()}})}se(Vc,{data:{},sourcePosition:{}},[],[],!0);var u1=ve(" <!>",1);function Yc(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]);Se(n,["data","targetPosition"]),ue(t,!1);let r=p(t,"data",28,()=>({label:"Node"})),o=p(t,"targetPosition",12,void 0);me(),zr();var i=u1(),s=$e(i),l=ye(s),u=ce(()=>o()??we.Top);return Bn(l,{type:"target",get position(){return g(u)}}),pe(()=>{var a;return bn(s,`${((a=r())==null?void 0:a.label)??""} `)}),K(e,i),de({get data(){return r()},set data(a){r(a),m()},get targetPosition(){return o()},set targetPosition(a){o(a),m()}})}se(Yc,{data:{},targetPosition:{}},[],[],!0);function Bc(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]);Se(n,[])}se(Bc,{},[],[],!0);function Xc(e,t,n){if(!t)return;const r=n?t.querySelector(n):t;r&&r.appendChild(e)}function Ks(e,{target:t,domNode:n}){return Xc(e,n,t),{async update({target:r,domNode:o}){Xc(e,o,r)},destroy(){e.parentNode&&e.parentNode.removeChild(e)}}}var d1=ve("<div><!></div>");function Wc(e,t){ue(t,!1);const n=ot(),r=()=>U(o,"$domNode",n),{domNode:o}=Je();me();var i=d1(),s=ge(i);et(s,t,"default",{},null),ae(i),ut(i,(l,u)=>Ks==null?void 0:Ks(l,u),()=>({target:".svelte-flow__edgelabel-renderer",domNode:r()})),K(e,i),de()}se(Wc,{},["default"],[],!0);function Kc(){const{edgeLookup:e,selectionRect:t,selectionRectMode:n,multiselectionKeyPressed:r,addSelectedEdges:o,unselectNodesAndEdges:i,elementsSelectable:s}=Je();return l=>{const u=R(e).get(l);if(!u){console.warn("012",hr.error012(l));return}(u.selectable||R(s)&&typeof u.selectable>"u")&&(t.set(null),n.set(null),u.selected?u.selected&&R(r)&&i({nodes:[],edges:[u]}):o([l]))}}var f1=ve('<div class="svelte-flow__edge-label" role="button" tabindex="-1"><!></div>');function Fc(e,t){ue(t,!1);let n=p(t,"style",12,void 0),r=p(t,"x",12,void 0),o=p(t,"y",12,void 0);const i=Kc(),s=To("svelteflow__edge_id");return me(),Wc(e,{children:(l,u)=>{var a=f1(),c=ge(a);et(c,t,"default",{},null),ae(a),pe(()=>{ee(a,"style","pointer-events: all;"+n()),nt(a,"transform",`translate(-50%, -50%) translate(${r()??""}px,${o()??""}px)`)}),Be("keyup",a,()=>{}),Be("click",a,()=>{s&&i(s)}),K(l,a)},$$slots:{default:!0}}),de({get style(){return n()},set style(l){n(l),m()},get x(){return r()},set x(l){r(l),m()},get y(){return o()},set y(l){o(l),m()}})}se(Fc,{style:{},x:{},y:{}},["default"],[],!0);var h1=je('<path fill="none" class="svelte-flow__edge-interaction"></path>'),g1=je('<path fill="none"></path><!><!>',1);function oo(e,t){ue(t,!1);let n=p(t,"id",12,void 0),r=p(t,"path",12),o=p(t,"label",12,void 0),i=p(t,"labelX",12,void 0),s=p(t,"labelY",12,void 0),l=p(t,"labelStyle",12,void 0),u=p(t,"markerStart",12,void 0),a=p(t,"markerEnd",12,void 0),c=p(t,"style",12,void 0),d=p(t,"interactionWidth",12,20),f=p(t,"class",12,void 0),h=d()===void 0?20:d();me();var y=g1(),_=$e(y);const C=ce(()=>Gt(dt(["svelte-flow__edge-path",f()])));var w=ye(_);{var v=x=>{var P=h1();ee(P,"stroke-opacity",0),ee(P,"stroke-width",h),pe(()=>ee(P,"d",r())),K(x,P)};We(w,x=>{h&&x(v)})}var E=ye(w);{var S=x=>{Fc(x,{get x(){return i()},get y(){return s()},get style(){return l()},children:(P,N)=>{zr();var O=Yr();pe(()=>bn(O,o())),K(P,O)},$$slots:{default:!0}})};We(E,x=>{o()&&x(S)})}return pe(()=>{ee(_,"id",n()),ee(_,"d",r()),Ln(_,g(C),""),ee(_,"marker-start",u()),ee(_,"marker-end",a()),ee(_,"style",c())}),K(e,y),de({get id(){return n()},set id(x){n(x),m()},get path(){return r()},set path(x){r(x),m()},get label(){return o()},set label(x){o(x),m()},get labelX(){return i()},set labelX(x){i(x),m()},get labelY(){return s()},set labelY(x){s(x),m()},get labelStyle(){return l()},set labelStyle(x){l(x),m()},get markerStart(){return u()},set markerStart(x){u(x),m()},get markerEnd(){return a()},set markerEnd(x){a(x),m()},get style(){return c()},set style(x){c(x),m()},get interactionWidth(){return d()},set interactionWidth(x){d(x),m()},get class(){return f()},set class(x){f(x),m()}})}se(oo,{id:{},path:{},label:{},labelX:{},labelY:{},labelStyle:{},markerStart:{},markerEnd:{},style:{},interactionWidth:{},class:{}},[],[],!0);function yi(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]);Se(n,["label","labelStyle","style","markerStart","markerEnd","interactionWidth","sourceX","sourceY","sourcePosition","targetX","targetY","targetPosition"]),ue(t,!1);const r=j(),o=j(),i=j();let s=p(t,"label",12,void 0),l=p(t,"labelStyle",12,void 0),u=p(t,"style",12,void 0),a=p(t,"markerStart",12,void 0),c=p(t,"markerEnd",12,void 0),d=p(t,"interactionWidth",12,void 0),f=p(t,"sourceX",12),h=p(t,"sourceY",12),y=p(t,"sourcePosition",12),_=p(t,"targetX",12),C=p(t,"targetY",12),w=p(t,"targetPosition",12);return oe(()=>(g(r),g(o),g(i),B(f()),B(h()),B(_()),B(C()),B(y()),B(w())),()=>{(v=>(X(r,v[0]),X(o,v[1]),X(i,v[2])))(bc({sourceX:f(),sourceY:h(),targetX:_(),targetY:C(),sourcePosition:y(),targetPosition:w()}))}),st(),me(),oo(e,{get path(){return g(r)},get labelX(){return g(o)},get labelY(){return g(i)},get label(){return s()},get labelStyle(){return l()},get markerStart(){return a()},get markerEnd(){return c()},get interactionWidth(){return d()},get style(){return u()}}),de({get label(){return s()},set label(v){s(v),m()},get labelStyle(){return l()},set labelStyle(v){l(v),m()},get style(){return u()},set style(v){u(v),m()},get markerStart(){return a()},set markerStart(v){a(v),m()},get markerEnd(){return c()},set markerEnd(v){c(v),m()},get interactionWidth(){return d()},set interactionWidth(v){d(v),m()},get sourceX(){return f()},set sourceX(v){f(v),m()},get sourceY(){return h()},set sourceY(v){h(v),m()},get sourcePosition(){return y()},set sourcePosition(v){y(v),m()},get targetX(){return _()},set targetX(v){_(v),m()},get targetY(){return C()},set targetY(v){C(v),m()},get targetPosition(){return w()},set targetPosition(v){w(v),m()}})}se(yi,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},sourcePosition:{},targetX:{},targetY:{},targetPosition:{}},[],[],!0);function Zc(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]);Se(n,["label","labelStyle","style","markerStart","markerEnd","interactionWidth","sourceX","sourceY","sourcePosition","targetX","targetY","targetPosition"]),ue(t,!1);const r=j(),o=j(),i=j();let s=p(t,"label",12,void 0),l=p(t,"labelStyle",12,void 0),u=p(t,"style",12,void 0),a=p(t,"markerStart",12,void 0),c=p(t,"markerEnd",12,void 0),d=p(t,"interactionWidth",12,void 0),f=p(t,"sourceX",12),h=p(t,"sourceY",12),y=p(t,"sourcePosition",12),_=p(t,"targetX",12),C=p(t,"targetY",12),w=p(t,"targetPosition",12);return oe(()=>(g(r),g(o),g(i),B(f()),B(h()),B(_()),B(C()),B(y()),B(w())),()=>{(v=>(X(r,v[0]),X(o,v[1]),X(i,v[2])))(hi({sourceX:f(),sourceY:h(),targetX:_(),targetY:C(),sourcePosition:y(),targetPosition:w()}))}),st(),me(),oo(e,{get path(){return g(r)},get labelX(){return g(o)},get labelY(){return g(i)},get label(){return s()},get labelStyle(){return l()},get markerStart(){return a()},get markerEnd(){return c()},get interactionWidth(){return d()},get style(){return u()}}),de({get label(){return s()},set label(v){s(v),m()},get labelStyle(){return l()},set labelStyle(v){l(v),m()},get style(){return u()},set style(v){u(v),m()},get markerStart(){return a()},set markerStart(v){a(v),m()},get markerEnd(){return c()},set markerEnd(v){c(v),m()},get interactionWidth(){return d()},set interactionWidth(v){d(v),m()},get sourceX(){return f()},set sourceX(v){f(v),m()},get sourceY(){return h()},set sourceY(v){h(v),m()},get sourcePosition(){return y()},set sourcePosition(v){y(v),m()},get targetX(){return _()},set targetX(v){_(v),m()},get targetY(){return C()},set targetY(v){C(v),m()},get targetPosition(){return w()},set targetPosition(v){w(v),m()}})}se(Zc,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},sourcePosition:{},targetX:{},targetY:{},targetPosition:{}},[],[],!0);function qc(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]);Se(n,["label","labelStyle","style","markerStart","markerEnd","interactionWidth","sourceX","sourceY","targetX","targetY"]),ue(t,!1);const r=j(),o=j(),i=j();let s=p(t,"label",12,void 0),l=p(t,"labelStyle",12,void 0),u=p(t,"style",12,void 0),a=p(t,"markerStart",12,void 0),c=p(t,"markerEnd",12,void 0),d=p(t,"interactionWidth",12,void 0),f=p(t,"sourceX",12),h=p(t,"sourceY",12),y=p(t,"targetX",12),_=p(t,"targetY",12);return oe(()=>(g(r),g(o),g(i),B(f()),B(h()),B(y()),B(_())),()=>{(C=>(X(r,C[0]),X(o,C[1]),X(i,C[2])))(Hs({sourceX:f(),sourceY:h(),targetX:y(),targetY:_()}))}),st(),me(),oo(e,{get path(){return g(r)},get labelX(){return g(o)},get labelY(){return g(i)},get label(){return s()},get labelStyle(){return l()},get markerStart(){return a()},get markerEnd(){return c()},get interactionWidth(){return d()},get style(){return u()}}),de({get label(){return s()},set label(C){s(C),m()},get labelStyle(){return l()},set labelStyle(C){l(C),m()},get style(){return u()},set style(C){u(C),m()},get markerStart(){return a()},set markerStart(C){a(C),m()},get markerEnd(){return c()},set markerEnd(C){c(C),m()},get interactionWidth(){return d()},set interactionWidth(C){d(C),m()},get sourceX(){return f()},set sourceX(C){f(C),m()},get sourceY(){return h()},set sourceY(C){h(C),m()},get targetX(){return y()},set targetX(C){y(C),m()},get targetY(){return _()},set targetY(C){_(C),m()}})}se(qc,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},targetX:{},targetY:{}},[],[],!0);function Gc(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]);Se(n,["label","labelStyle","style","markerStart","markerEnd","interactionWidth","sourceX","sourceY","sourcePosition","targetX","targetY","targetPosition"]),ue(t,!1);const r=j(),o=j(),i=j();let s=p(t,"label",12,void 0),l=p(t,"labelStyle",12,void 0),u=p(t,"style",12,void 0),a=p(t,"markerStart",12,void 0),c=p(t,"markerEnd",12,void 0),d=p(t,"interactionWidth",12,void 0),f=p(t,"sourceX",12),h=p(t,"sourceY",12),y=p(t,"sourcePosition",12),_=p(t,"targetX",12),C=p(t,"targetY",12),w=p(t,"targetPosition",12);return oe(()=>(g(r),g(o),g(i),B(f()),B(h()),B(_()),B(C()),B(y()),B(w())),()=>{(v=>(X(r,v[0]),X(o,v[1]),X(i,v[2])))(hi({sourceX:f(),sourceY:h(),targetX:_(),targetY:C(),sourcePosition:y(),targetPosition:w(),borderRadius:0}))}),st(),me(),oo(e,{get path(){return g(r)},get labelX(){return g(o)},get labelY(){return g(i)},get label(){return s()},get labelStyle(){return l()},get markerStart(){return a()},get markerEnd(){return c()},get interactionWidth(){return d()},get style(){return u()}}),de({get label(){return s()},set label(v){s(v),m()},get labelStyle(){return l()},set labelStyle(v){l(v),m()},get style(){return u()},set style(v){u(v),m()},get markerStart(){return a()},set markerStart(v){a(v),m()},get markerEnd(){return c()},set markerEnd(v){c(v),m()},get interactionWidth(){return d()},set interactionWidth(v){d(v),m()},get sourceX(){return f()},set sourceX(v){f(v),m()},get sourceY(){return h()},set sourceY(v){h(v),m()},get sourcePosition(){return y()},set sourcePosition(v){y(v),m()},get targetX(){return _()},set targetX(v){_(v),m()},get targetY(){return C()},set targetY(v){C(v),m()},get targetPosition(){return w()},set targetPosition(v){w(v),m()}})}se(Gc,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},sourcePosition:{},targetX:{},targetY:{},targetPosition:{}},[],[],!0);function v1(e,t){const n=e.set,r=t.set,o=R(e),i=R(t);let l=o.length===0&&i.length>0?i:o;e.set(l);const u=a=>{const c=n(a);return l=c,r(l),c};e.set=t.set=u,e.update=t.update=a=>u(a(l))}function y1(e,t){const n=e.set,r=t.set;let o=R(t);e.set(o);const i=s=>{n(s),r(s),o=s};e.set=t.set=i,e.update=t.update=s=>i(s(o))}const m1=(e,t,n)=>{if(!n)return;const r=R(e),o=t.set,i=n.set;let s=n?R(n):{x:0,y:0,zoom:1};t.set(s),t.set=l=>(o(l),i(l),s=l,l),n.set=l=>(r==null||r.syncViewport(l),o(l),i(l),s=l,l),t.update=l=>{t.set(l(s))},n.update=l=>{n.set(l(s))}},p1=(e,t,n,r=[0,0],o=ii)=>{const{subscribe:i,set:s,update:l}=le([]);let u=e,a={},c=!0;const d=_=>(Mc(_,t,n,{elevateNodesOnSelect:c,nodeOrigin:r,nodeExtent:o,defaults:a,checkEquality:!1}),u=_,s(u),u),f=_=>d(_(u)),h=_=>{a=_},y=_=>{c=_.elevateNodesOnSelect??c};return d(u),{subscribe:i,set:d,update:f,setDefaultOptions:h,setOptions:y}},w1=(e,t,n,r)=>{const{subscribe:o,set:i,update:s}=le([]);let l=e,u={};const a=f=>{const h=u?f.map(y=>({...u,...y})):f;Oc(t,n,h),l=h,i(l)},c=f=>a(f(l)),d=f=>{u=f};return a(l),{subscribe:o,set:a,update:c,setDefaultOptions:d}},Uc={input:Vc,output:Yc,default:vi,group:Bc},jc={straight:qc,smoothstep:Zc,default:yi,step:Gc},_1=({nodes:e=[],edges:t=[],width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s})=>{const l=new Map,u=new Map,a=new Map,c=new Map,d=i??[0,0],f=s??ii;Mc(e,l,u,{nodeExtent:f,nodeOrigin:d,elevateNodesOnSelect:!1,checkEquality:!1}),Oc(a,c,t);let h={x:0,y:0,zoom:1};if(o&&n&&r){const y=eo(l,{filter:_=>!!((_.width||_.initialWidth)&&(_.height||_.initialHeight))});h=Ds(y,n,r,.5,2,.1)}return{flowId:le(null),nodes:p1(e,l,u,d,f),nodeLookup:Nt(l),parentLookup:Nt(u),edgeLookup:Nt(c),visibleNodes:Nt([]),edges:w1(t,a,c),visibleEdges:Nt([]),connectionLookup:Nt(a),height:le(500),width:le(500),minZoom:le(.5),maxZoom:le(2),nodeOrigin:le(d),nodeDragThreshold:le(1),nodeExtent:le(f),translateExtent:le(ii),autoPanOnNodeDrag:le(!0),autoPanOnConnect:le(!0),fitViewOnInit:le(!1),fitViewOnInitDone:le(!1),fitViewOptions:le(void 0),panZoom:le(null),snapGrid:le(null),dragging:le(!1),selectionRect:le(null),selectionKeyPressed:le(!1),multiselectionKeyPressed:le(!1),deleteKeyPressed:le(!1),panActivationKeyPressed:le(!1),zoomActivationKeyPressed:le(!1),selectionRectMode:le(null),selectionMode:le(si.Partial),nodeTypes:le(Uc),edgeTypes:le(jc),viewport:le(h),connectionMode:le(Vn.Strict),domNode:le(null),connection:Nt(Ns),connectionLineType:le(gr.Bezier),connectionRadius:le(20),isValidConnection:le(()=>!0),nodesDraggable:le(!0),nodesConnectable:le(!0),elementsSelectable:le(!0),selectNodesOnDrag:le(!0),markers:Nt([]),defaultMarkerColor:le("#b1b1b7"),lib:Nt("svelte"),onlyRenderVisibleElements:le(!1),onerror:le(vc),ondelete:le(void 0),onedgecreate:le(void 0),onconnect:le(void 0),onconnectstart:le(void 0),onconnectend:le(void 0),onbeforedelete:le(void 0),nodesInitialized:le(!1),edgesInitialized:le(!1),viewportInitialized:le(!1),initialized:Nt(!1)}};function b1(e){const t=ar([e.edges,e.nodes,e.nodeLookup,e.onlyRenderVisibleElements,e.viewport,e.width,e.height],([n,,r,o,i,s,l])=>o&&s&&l?n.filter(a=>{const c=r.get(a.source),d=r.get(a.target);return c&&d&&M0({sourceNode:c,targetNode:d,width:s,height:l,transform:[i.x,i.y,i.zoom]})}):n);return ar([t,e.nodes,e.nodeLookup,e.connectionMode,e.onerror],([n,,r,o,i])=>n.reduce((l,u)=>{const a=r.get(u.source),c=r.get(u.target);if(!a||!c)return l;const d=L0({id:u.id,sourceNode:a,targetNode:c,sourceHandle:u.sourceHandle||null,targetHandle:u.targetHandle||null,connectionMode:o,onError:i});return d&&l.push({...u,zIndex:P0({selected:u.selected,zIndex:u.zIndex,sourceNode:a,targetNode:c,elevateOnSelect:!1}),...d}),l},[]))}function x1(e){return ar([e.nodeLookup,e.onlyRenderVisibleElements,e.width,e.height,e.viewport,e.nodes],([t,n,r,o,i])=>{const s=[i.x,i.y,i.zoom];return n?sc(t,{x:0,y:0,width:r,height:o},s,!0):Array.from(t.values())})}const mi=Symbol();function Jc({nodes:e,edges:t,width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s}){const l=_1({nodes:e,edges:t,width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s});function u(b){l.nodeTypes.set({...Uc,...b})}function a(b){l.edgeTypes.set({...jc,...b})}function c(b){const M=R(l.edges);l.edges.set(T0(b,M))}const d=(b,M=!1)=>{var D;const A=R(l.nodeLookup);for(const[Y,Z]of b){const Q=(D=A.get(Y))==null?void 0:D.internals.userNode;Q&&(Q.position=Z.position,Q.dragging=M)}l.nodes.update(Y=>Y)};function f(b){var Z,Q,G;const M=R(l.nodeLookup),A=R(l.parentLookup),{changes:D,updatedInternals:Y}=B0(b,M,R(l.parentLookup),R(l.domNode),R(l.nodeOrigin));if(Y){if($0(M,A,{nodeOrigin:i,nodeExtent:s}),!R(l.fitViewOnInitDone)&&R(l.fitViewOnInit)){const F=R(l.fitViewOptions),ne=y({...F,nodes:F==null?void 0:F.nodes});l.fitViewOnInitDone.set(ne)}for(const F of D){const ne=(Z=M.get(F.id))==null?void 0:Z.internals.userNode;if(ne)switch(F.type){case"dimensions":{const fe={...ne.measured,...F.dimensions};F.setAttributes&&(ne.width=((Q=F.dimensions)==null?void 0:Q.width)??ne.width,ne.height=((G=F.dimensions)==null?void 0:G.height)??ne.height),ne.measured=fe;break}case"position":ne.position=F.position??ne.position;break}}l.nodes.update(F=>F),R(l.nodesInitialized)||l.nodesInitialized.set(!0)}}function h(b){const M=R(l.panZoom),A=R(l.domNode);if(!M||!A)return Promise.resolve(!1);const{width:D,height:Y}=Is(A),Z=lc(R(l.nodeLookup),b);return ac({nodes:Z,width:D,height:Y,minZoom:R(l.minZoom),maxZoom:R(l.maxZoom),panZoom:M},b)}function y(b){const M=R(l.panZoom);if(!M)return!1;const A=lc(R(l.nodeLookup),b);return ac({nodes:A,width:R(l.width),height:R(l.height),minZoom:R(l.minZoom),maxZoom:R(l.maxZoom),panZoom:M},b),A.size>0}function _(b,M){const A=R(l.panZoom);return A?A.scaleBy(b,M):Promise.resolve(!1)}function C(b){return _(1.2,b)}function w(b){return _(1/1.2,b)}function v(b){const M=R(l.panZoom);M&&(M.setScaleExtent([b,R(l.maxZoom)]),l.minZoom.set(b))}function E(b){const M=R(l.panZoom);M&&(M.setScaleExtent([R(l.minZoom),b]),l.maxZoom.set(b))}function S(b){const M=R(l.panZoom);M&&(M.setTranslateExtent(b),l.translateExtent.set(b))}function x(b){let M=!1;return b.forEach(A=>{A.selected&&(A.selected=!1,M=!0)}),M}function P(b){var M;(M=R(l.panZoom))==null||M.setClickDistance(b)}function N(b){x((b==null?void 0:b.nodes)||R(l.nodes))&&l.nodes.set(R(l.nodes)),x((b==null?void 0:b.edges)||R(l.edges))&&l.edges.set(R(l.edges))}l.deleteKeyPressed.subscribe(async b=>{var M;if(b){const A=R(l.nodes),D=R(l.edges),Y=A.filter(F=>F.selected),Z=D.filter(F=>F.selected),{nodes:Q,edges:G}=await cc({nodesToRemove:Y,edgesToRemove:Z,nodes:A,edges:D,onBeforeDelete:R(l.onbeforedelete)});(Q.length||G.length)&&(l.nodes.update(F=>F.filter(ne=>!Q.some(fe=>fe.id===ne.id))),l.edges.update(F=>F.filter(ne=>!G.some(fe=>fe.id===ne.id))),(M=R(l.ondelete))==null||M({nodes:Q,edges:G}))}});function O(b){const M=R(l.multiselectionKeyPressed);l.nodes.update(A=>A.map(D=>{const Y=b.includes(D.id),Z=M&&D.selected||Y;return D.selected=Z,D})),M||l.edges.update(A=>A.map(D=>(D.selected=!1,D)))}function T(b){const M=R(l.multiselectionKeyPressed);l.edges.update(A=>A.map(D=>{const Y=b.includes(D.id),Z=M&&D.selected||Y;return D.selected=Z,D})),M||l.nodes.update(A=>A.map(D=>(D.selected=!1,D)))}function L(b){var A;const M=(A=R(l.nodes))==null?void 0:A.find(D=>D.id===b);if(!M){console.warn("012",hr.error012(b));return}l.selectionRect.set(null),l.selectionRectMode.set(null),M.selected?M.selected&&R(l.multiselectionKeyPressed)&&N({nodes:[M],edges:[]}):O([b])}function V(b){const M=R(l.viewport);return X0({delta:b,panZoom:R(l.panZoom),transform:[M.x,M.y,M.zoom],translateExtent:R(l.translateExtent),width:R(l.width),height:R(l.height)})}const $=le(Ns),H=b=>{$.set({...b})};function k(){$.set(Ns)}function I(){l.fitViewOnInitDone.set(!1),l.selectionRect.set(null),l.selectionRectMode.set(null),l.snapGrid.set(null),l.isValidConnection.set(()=>!0),N(),k()}return{...l,visibleEdges:b1(l),visibleNodes:x1(l),connection:ar([$,l.viewport],([b,M])=>b.inProgress?{...b,to:no(b.to,[M.x,M.y,M.zoom])}:{...b}),markers:ar([l.edges,l.defaultMarkerColor,l.flowId],([b,M,A])=>I0(b,{defaultColor:M,id:A})),initialized:(()=>{let b=!1;const M=R(l.nodes).length,A=R(l.edges).length;return ar([l.nodesInitialized,l.edgesInitialized,l.viewportInitialized],([D,Y,Z])=>b||(M===0?b=Z:A===0?b=Z&&D:b=Z&&D&&Y,b))})(),syncNodeStores:b=>v1(l.nodes,b),syncEdgeStores:b=>y1(l.edges,b),syncViewport:b=>m1(l.panZoom,l.viewport,b),setNodeTypes:u,setEdgeTypes:a,addEdge:c,updateNodePositions:d,updateNodeInternals:f,zoomIn:C,zoomOut:w,fitView:b=>h(b),setMinZoom:v,setMaxZoom:E,setTranslateExtent:S,setPaneClickDistance:P,unselectNodesAndEdges:N,addSelectedNodes:O,addSelectedEdges:T,handleNodeSelection:L,panBy:V,updateConnection:H,cancelConnection:k,reset:I}}function Je(){const e=To(mi);if(!e)throw new Error("In order to use useStore you need to wrap your component in a <SvelteFlowProvider />");return e.getStore()}function C1({nodes:e,edges:t,width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s}){const l=Jc({nodes:e,edges:t,width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s});return nr(mi,{getStore:()=>l}),l}function Fs(e,t){const{panZoom:n,minZoom:r,maxZoom:o,initialViewport:i,viewport:s,dragging:l,translateExtent:u,paneClickDistance:a}=t,c=s1({domNode:e,minZoom:r,maxZoom:o,translateExtent:u,viewport:i,paneClickDistance:a,onDraggingChange:l.set}),d=c.getViewport();return s.set(d),n.set(c),c.update(t),{update(f){c.update(f)}}}var k1=ve('<div class="svelte-flow__zoom svelte-4xkw84"><!></div>');const E1={hash:"svelte-4xkw84",code:".svelte-flow__zoom.svelte-4xkw84 {width:100%;height:100%;position:absolute;top:0;left:0;z-index:4;}"};function Qc(e,t){ue(t,!1),qt(e,E1);const n=ot(),r=()=>U(M,"$panActivationKeyPressed",n),o=()=>U($,"$minZoom",n),i=()=>U(H,"$maxZoom",n),s=()=>U(A,"$zoomActivationKeyPressed",n),l=()=>U(V,"$selectionRect",n),u=()=>U(I,"$translateExtent",n),a=()=>U(b,"$lib",n),c=j(),d=j(),f=j();let h=p(t,"initialViewport",12,void 0),y=p(t,"onMoveStart",12,void 0),_=p(t,"onMove",12,void 0),C=p(t,"onMoveEnd",12,void 0),w=p(t,"panOnScrollMode",12),v=p(t,"preventScrolling",12),E=p(t,"zoomOnScroll",12),S=p(t,"zoomOnDoubleClick",12),x=p(t,"zoomOnPinch",12),P=p(t,"panOnDrag",12),N=p(t,"panOnScroll",12),O=p(t,"paneClickDistance",12);const{viewport:T,panZoom:L,selectionRect:V,minZoom:$,maxZoom:H,dragging:k,translateExtent:I,lib:b,panActivationKeyPressed:M,zoomActivationKeyPressed:A,viewportInitialized:D}=Je(),Y=G=>T.set({x:G[0],y:G[1],zoom:G[2]});sr(()=>{Ho(D,!0)}),oe(()=>B(h()),()=>{X(c,h()||{x:0,y:0,zoom:1})}),oe(()=>(r(),B(P())),()=>{X(d,r()||P())}),oe(()=>(r(),B(N())),()=>{X(f,r()||N())}),st(),me();var Z=k1(),Q=ge(Z);return et(Q,t,"default",{},null),ae(Z),ut(Z,(G,F)=>Fs==null?void 0:Fs(G,F),()=>({viewport:T,minZoom:o(),maxZoom:i(),initialViewport:g(c),dragging:k,panZoom:L,onPanZoomStart:y(),onPanZoom:_(),onPanZoomEnd:C(),zoomOnScroll:E(),zoomOnDoubleClick:S(),zoomOnPinch:x(),panOnScroll:g(f),panOnDrag:g(d),panOnScrollSpeed:.5,panOnScrollMode:w()||En.Free,zoomActivationKeyPressed:s(),preventScrolling:typeof v()=="boolean"?v():!0,noPanClassName:"nopan",noWheelClassName:"nowheel",userSelectionActive:!!l(),translateExtent:u(),lib:a(),paneClickDistance:O(),onTransformChange:Y})),K(e,Z),de({get initialViewport(){return h()},set initialViewport(G){h(G),m()},get onMoveStart(){return y()},set onMoveStart(G){y(G),m()},get onMove(){return _()},set onMove(G){_(G),m()},get onMoveEnd(){return C()},set onMoveEnd(G){C(G),m()},get panOnScrollMode(){return w()},set panOnScrollMode(G){w(G),m()},get preventScrolling(){return v()},set preventScrolling(G){v(G),m()},get zoomOnScroll(){return E()},set zoomOnScroll(G){E(G),m()},get zoomOnDoubleClick(){return S()},set zoomOnDoubleClick(G){S(G),m()},get zoomOnPinch(){return x()},set zoomOnPinch(G){x(G),m()},get panOnDrag(){return P()},set panOnDrag(G){P(G),m()},get panOnScroll(){return N()},set panOnScroll(G){N(G),m()},get paneClickDistance(){return O()},set paneClickDistance(G){O(G),m()}})}se(Qc,{initialViewport:{},onMoveStart:{},onMove:{},onMoveEnd:{},panOnScrollMode:{},preventScrolling:{},zoomOnScroll:{},zoomOnDoubleClick:{},zoomOnPinch:{},panOnDrag:{},panOnScroll:{},paneClickDistance:{}},["default"],[],!0);function eu(e,t){return n=>{n.target===t&&(e==null||e(n))}}function tu(e){return t=>{const n=e.includes(t.id);return t.selected!==n&&(t.selected=n),t}}var S1=ve('<div class="svelte-flow__pane svelte-1esy7hx"><!></div>');const P1={hash:"svelte-1esy7hx",code:".svelte-flow__pane.svelte-1esy7hx {position:absolute;top:0;left:0;width:100%;height:100%;}"};function nu(e,t){ue(t,!1),qt(e,P1);const n=ot(),r=()=>U(H,"$panActivationKeyPressed",n),o=()=>U(V,"$selectionKeyPressed",n),i=()=>U(T,"$selectionRect",n),s=()=>U(O,"$elementsSelectable",n),l=()=>U(L,"$selectionRectMode",n),u=()=>U(x,"$edges",n),a=()=>U(S,"$nodeLookup",n),c=()=>U(P,"$viewport",n),d=()=>U($,"$selectionMode",n),f=()=>U(N,"$dragging",n),h=j(),y=j(),_=j();let C=p(t,"panOnDrag",12,void 0),w=p(t,"selectionOnDrag",12,void 0);const v=Lo(),{nodes:E,nodeLookup:S,edges:x,viewport:P,dragging:N,elementsSelectable:O,selectionRect:T,selectionRectMode:L,selectionKeyPressed:V,selectionMode:$,panActivationKeyPressed:H,unselectNodesAndEdges:k}=Je();let I=j(),b=null,M=[],A=!1;function D(J){if(A){A=!1;return}v("paneclick",{event:J}),k(),L.set(null)}function Y(J){var _e,Xe;if(b=g(I).getBoundingClientRect(),!O||!g(y)||J.button!==0||J.target!==g(I)||!b)return;(Xe=(_e=J.target)==null?void 0:_e.setPointerCapture)==null||Xe.call(_e,J.pointerId);const{x:te,y:he}=cn(J,b);k(),T.set({width:0,height:0,startX:te,startY:he,x:te,y:he})}function Z(J){if(!g(y)||!b||!i())return;A=!0;const te=cn(J,b),he=i().startX??0,_e=i().startY??0,Xe={...i(),x:te.x<he?te.x:he,y:te.y<_e?te.y:_e,width:Math.abs(te.x-he),height:Math.abs(te.y-_e)},q=M.map(He=>He.id),Ye=Ts(M,u()).map(He=>He.id);M=sc(a(),Xe,[c().x,c().y,c().zoom],d()===si.Partial,!0);const Ae=Ts(M,u()).map(He=>He.id),Ge=M.map(He=>He.id);(q.length!==Ge.length||Ge.some(He=>!q.includes(He)))&&E.update(He=>He.map(tu(Ge))),(Ye.length!==Ae.length||Ae.some(He=>!Ye.includes(He)))&&x.update(He=>He.map(tu(Ae))),L.set("user"),T.set(Xe)}function Q(J){var te,he;J.button===0&&((he=(te=J.target)==null?void 0:te.releasePointerCapture)==null||he.call(te,J.pointerId),!g(y)&&l()==="user"&&J.target===g(I)&&(D==null||D(J)),T.set(null),M.length>0&&Ho(L,"nodes"),o()&&(A=!1))}const G=J=>{var te;if(Array.isArray(g(h))&&((te=g(h))!=null&&te.includes(2))){J.preventDefault();return}v("panecontextmenu",{event:J})};oe(()=>(r(),B(C())),()=>{X(h,r()||C())}),oe(()=>(o(),i(),B(w()),g(h)),()=>{X(y,o()||i()||w()&&g(h)!==!0)}),oe(()=>(s(),g(y),l()),()=>{X(_,s()&&(g(y)||l()==="user"))}),st(),me();var F=S1(),ne=Un(()=>g(_)?void 0:eu(D,g(I))),fe=Un(()=>eu(G,g(I)));const re=ce(()=>C()===!0||Array.isArray(C())&&C().includes(0));pe(()=>qe(F,"draggable",g(re)));var Ee=ge(F);return et(Ee,t,"default",{},null),ae(F),ir(F,J=>X(I,J),()=>g(I)),pe(()=>{qe(F,"dragging",f()),qe(F,"selection",g(y))}),Be("click",F,function(...J){var te;(te=g(ne))==null||te.apply(this,J)}),Be("pointerdown",F,function(...J){var te;(te=g(_)?Y:void 0)==null||te.apply(this,J)}),Be("pointermove",F,function(...J){var te;(te=g(_)?Z:void 0)==null||te.apply(this,J)}),Be("pointerup",F,function(...J){var te;(te=g(_)?Q:void 0)==null||te.apply(this,J)}),Be("contextmenu",F,function(...J){var te;(te=g(fe))==null||te.apply(this,J)}),K(e,F),de({get panOnDrag(){return C()},set panOnDrag(J){C(J),m()},get selectionOnDrag(){return w()},set selectionOnDrag(J){w(J),m()}})}se(nu,{panOnDrag:{},selectionOnDrag:{}},["default"],[],!0);var M1=ve('<div class="svelte-flow__viewport xyflow__viewport svelte-1floaup"><!></div>');const N1={hash:"svelte-1floaup",code:".svelte-flow__viewport.svelte-1floaup {width:100%;height:100%;position:absolute;top:0;left:0;}"};function ru(e,t){ue(t,!1),qt(e,N1);const n=ot(),r=()=>U(o,"$viewport",n),{viewport:o}=Je();me();var i=M1(),s=ge(i);et(s,t,"default",{},null),ae(i),pe(()=>ee(i,"style",`transform: translate(${r().x??""}px, ${r().y??""}px) scale(${r().zoom??""})`)),K(e,i),de()}se(ru,{},["default"],[],!0);function wr(e,t){const{store:n,onDrag:r,onDragStart:o,onDragStop:i,onNodeMouseDown:s}=t,l=K0({onDrag:r,onDragStart:o,onDragStop:i,onNodeMouseDown:s,getStoreItems:()=>{const a=R(n.snapGrid),c=R(n.viewport);return{nodes:R(n.nodes),nodeLookup:R(n.nodeLookup),edges:R(n.edges),nodeExtent:R(n.nodeExtent),snapGrid:a||[0,0],snapToGrid:!!a,nodeOrigin:R(n.nodeOrigin),multiSelectionActive:R(n.multiselectionKeyPressed),domNode:R(n.domNode),transform:[c.x,c.y,c.zoom],autoPanOnNodeDrag:R(n.autoPanOnNodeDrag),nodesDraggable:R(n.nodesDraggable),selectNodesOnDrag:R(n.selectNodesOnDrag),nodeDragThreshold:R(n.nodeDragThreshold),unselectNodesAndEdges:n.unselectNodesAndEdges,updateNodePositions:n.updateNodePositions,panBy:n.panBy}}});function u(a,c){if(c.disabled){l.destroy();return}l.update({domNode:a,noDragClassName:c.noDragClass,handleSelector:c.handleSelector,nodeId:c.nodeId,isSelectable:c.isSelectable,nodeClickDistance:c.nodeClickDistance})}return u(e,t),{update(a){u(e,a)},destroy(){l.destroy()}}}function O1({width:e,height:t,initialWidth:n,initialHeight:r,measuredWidth:o,measuredHeight:i}){if(o===void 0&&i===void 0){const s=e??n,l=t??r;return{width:s?`width:${s}px;`:"",height:l?`height:${l}px;`:""}}return{width:e?`width:${e}px;`:"",height:t?`height:${t}px;`:""}}var T1=ve("<div><!></div>");function ou(e,t){ue(t,!1);const n=ot(),r=()=>U(F,"$nodeTypes",n),o=()=>U(_e,"$connectableStore",n),i=j(void 0,!0),s=j(void 0,!0),l=j(void 0,!0),u=j(void 0,!0);let a=p(t,"node",13),c=p(t,"id",13),d=p(t,"data",29,()=>({})),f=p(t,"selected",13,!1),h=p(t,"draggable",13,void 0),y=p(t,"selectable",13,void 0),_=p(t,"connectable",13,!0),C=p(t,"deletable",13,!0),w=p(t,"hidden",13,!1),v=p(t,"dragging",13,!1),E=p(t,"resizeObserver",13,null),S=p(t,"style",13,void 0),x=p(t,"type",13,"default"),P=p(t,"isParent",13,!1),N=p(t,"positionX",13),O=p(t,"positionY",13),T=p(t,"sourcePosition",13,void 0),L=p(t,"targetPosition",13,void 0),V=p(t,"zIndex",13),$=p(t,"measuredWidth",13,void 0),H=p(t,"measuredHeight",13,void 0),k=p(t,"initialWidth",13,void 0),I=p(t,"initialHeight",13,void 0),b=p(t,"width",13,void 0),M=p(t,"height",13,void 0),A=p(t,"dragHandle",13,void 0),D=p(t,"initialized",13,!1),Y=p(t,"parentId",13,void 0),Z=p(t,"nodeClickDistance",13,void 0),Q=p(t,"class",13,"");const G=Je(),{nodeTypes:F,nodeDragThreshold:ne,selectNodesOnDrag:fe,handleNodeSelection:re,updateNodeInternals:Ee}=G;let J=j(void 0,!0),te=j(null,!0);const he=Lo(),_e=le(_());let Xe=j(void 0,!0),q=j(void 0,!0),Ye=j(void 0,!0);nr("svelteflow__node_id",c()),nr("svelteflow__node_connectable",_e),as(()=>{var W;g(te)&&((W=E())==null||W.unobserve(g(te)))});function Ae(W){y()&&(!R(fe)||!h()||R(ne)>0)&&re(c()),he("nodeclick",{node:a().internals.userNode,event:W})}oe(()=>B(x()),()=>{X(i,x()||"default")}),oe(()=>(r(),g(i)),()=>{X(s,!!r()[g(i)])}),oe(()=>(r(),g(i),vi),()=>{X(l,r()[g(i)]||vi)}),oe(()=>(g(s),B(x())),()=>{g(s)||console.warn("003",hr.error003(x()))}),oe(()=>(B(b()),B(M()),B(k()),B(I()),B($()),B(H())),()=>{X(u,O1({width:b(),height:M(),initialWidth:k(),initialHeight:I(),measuredWidth:$(),measuredHeight:H()}))}),oe(()=>B(_()),()=>{_e.set(!!_())}),oe(()=>(g(Xe),g(i),g(q),B(T()),g(Ye),B(L()),B(c()),g(J)),()=>{(g(Xe)&&g(i)!==g(Xe)||g(q)&&T()!==g(q)||g(Ye)&&L()!==g(Ye))&&requestAnimationFrame(()=>Ee(new Map([[c(),{id:c(),nodeElement:g(J),force:!0}]]))),X(Xe,g(i)),X(q,T()),X(Ye,L())}),oe(()=>(B(E()),g(J),g(te),B(D())),()=>{E()&&(g(J)!==g(te)||!D())&&(g(te)&&E().unobserve(g(te)),g(J)&&E().observe(g(J)),X(te,g(J)))}),st(),me(!0);var Ge=at(),He=$e(Ge);{var Fe=W=>{var Ce=T1();const Ze=ce(()=>Gt(dt(["svelte-flow__node",`svelte-flow__node-${g(i)}`,Q()])));var ft=ge(Ce);ea(ft,()=>g(l),(ze,Qe)=>{Qe(ze,{get data(){return d()},get id(){return c()},get selected(){return f()},get selectable(){return y()},get deletable(){return C()},get sourcePosition(){return T()},get targetPosition(){return L()},get zIndex(){return V()},get dragging(){return v()},get draggable(){return h()},get dragHandle(){return A()},get parentId(){return Y()},get type(){return g(i)},get isConnectable(){return o()},get positionAbsoluteX(){return N()},get positionAbsoluteY(){return O()},get width(){return b()},get height(){return M()}})}),ae(Ce),ut(Ce,(ze,Qe)=>wr==null?void 0:wr(ze,Qe),()=>({nodeId:c(),isSelectable:y(),disabled:!1,handleSelector:A(),noDragClass:"nodrag",nodeClickDistance:Z(),onNodeMouseDown:re,onDrag:(ze,Qe,ie,De)=>{he("nodedrag",{event:ze,targetNode:ie,nodes:De})},onDragStart:(ze,Qe,ie,De)=>{he("nodedragstart",{event:ze,targetNode:ie,nodes:De})},onDragStop:(ze,Qe,ie,De)=>{he("nodedragstop",{event:ze,targetNode:ie,nodes:De})},store:G})),ir(Ce,ze=>X(J,ze),()=>g(J)),xt(()=>Be("click",Ce,Ae)),xt(()=>Be("mouseenter",Ce,ze=>he("nodemouseenter",{node:a(),event:ze}))),xt(()=>Be("mouseleave",Ce,ze=>he("nodemouseleave",{node:a(),event:ze}))),xt(()=>Be("mousemove",Ce,ze=>he("nodemousemove",{node:a(),event:ze}))),xt(()=>Be("contextmenu",Ce,ze=>he("nodecontextmenu",{node:a(),event:ze}))),pe(()=>{ee(Ce,"data-id",c()),or(Ce,g(Ze),""),ee(Ce,"style",`${S()??""??""};${g(u).width??""}${g(u).height??""}`),qe(Ce,"dragging",v()),qe(Ce,"selected",f()),qe(Ce,"draggable",h()),qe(Ce,"connectable",_()),qe(Ce,"selectable",y()),qe(Ce,"nopan",h()),qe(Ce,"parent",P()),nt(Ce,"z-index",V()),nt(Ce,"transform",`translate(${N()??""}px, ${O()??""}px)`),nt(Ce,"visibility",D()?"visible":"hidden")}),K(W,Ce)};We(He,W=>{w()||W(Fe)})}return K(e,Ge),de({get node(){return a()},set node(W){a(W),m()},get id(){return c()},set id(W){c(W),m()},get data(){return d()},set data(W){d(W),m()},get selected(){return f()},set selected(W){f(W),m()},get draggable(){return h()},set draggable(W){h(W),m()},get selectable(){return y()},set selectable(W){y(W),m()},get connectable(){return _()},set connectable(W){_(W),m()},get deletable(){return C()},set deletable(W){C(W),m()},get hidden(){return w()},set hidden(W){w(W),m()},get dragging(){return v()},set dragging(W){v(W),m()},get resizeObserver(){return E()},set resizeObserver(W){E(W),m()},get style(){return S()},set style(W){S(W),m()},get type(){return x()},set type(W){x(W),m()},get isParent(){return P()},set isParent(W){P(W),m()},get positionX(){return N()},set positionX(W){N(W),m()},get positionY(){return O()},set positionY(W){O(W),m()},get sourcePosition(){return T()},set sourcePosition(W){T(W),m()},get targetPosition(){return L()},set targetPosition(W){L(W),m()},get zIndex(){return V()},set zIndex(W){V(W),m()},get measuredWidth(){return $()},set measuredWidth(W){$(W),m()},get measuredHeight(){return H()},set measuredHeight(W){H(W),m()},get initialWidth(){return k()},set initialWidth(W){k(W),m()},get initialHeight(){return I()},set initialHeight(W){I(W),m()},get width(){return b()},set width(W){b(W),m()},get height(){return M()},set height(W){M(W),m()},get dragHandle(){return A()},set dragHandle(W){A(W),m()},get initialized(){return D()},set initialized(W){D(W),m()},get parentId(){return Y()},set parentId(W){Y(W),m()},get nodeClickDistance(){return Z()},set nodeClickDistance(W){Z(W),m()},get class(){return Q()},set class(W){Q(W),m()}})}se(ou,{node:{},id:{},data:{},selected:{},draggable:{},selectable:{},connectable:{},deletable:{},hidden:{},dragging:{},resizeObserver:{},style:{},type:{},isParent:{},positionX:{},positionY:{},sourcePosition:{},targetPosition:{},zIndex:{},measuredWidth:{},measuredHeight:{},initialWidth:{},initialHeight:{},width:{},height:{},dragHandle:{},initialized:{},parentId:{},nodeClickDistance:{},class:{}},[],[],!0);var A1=ve('<div class="svelte-flow__nodes svelte-tf4uy4"></div>');const z1={hash:"svelte-tf4uy4",code:".svelte-flow__nodes.svelte-tf4uy4 {width:100%;height:100%;position:absolute;left:0;top:0;}"};function iu(e,t){ue(t,!1),qt(e,z1);const n=ot(),r=()=>U(a,"$visibleNodes",n),o=()=>U(c,"$nodesDraggable",n),i=()=>U(f,"$elementsSelectable",n),s=()=>U(d,"$nodesConnectable",n),l=()=>U(y,"$parentLookup",n);let u=p(t,"nodeClickDistance",12,0);const{visibleNodes:a,nodesDraggable:c,nodesConnectable:d,elementsSelectable:f,updateNodeInternals:h,parentLookup:y}=Je(),_=typeof ResizeObserver>"u"?null:new ResizeObserver(w=>{const v=new Map;w.forEach(E=>{const S=E.target.getAttribute("data-id");v.set(S,{id:S,nodeElement:E.target,force:!0})}),h(v)});as(()=>{_==null||_.disconnect()}),me();var C=A1();return xn(C,5,r,w=>w.id,(w,v)=>{var E=ce(()=>!!g(v).selected),S=ce(()=>!!g(v).hidden),x=ce(()=>!!(g(v).draggable||o()&&typeof g(v).draggable>"u")),P=ce(()=>!!(g(v).selectable||i()&&typeof g(v).selectable>"u")),N=ce(()=>!!(g(v).connectable||s()&&typeof g(v).connectable>"u")),O=ce(()=>g(v).deletable??!0),T=ce(()=>l().has(g(v).id)),L=ce(()=>g(v).type??"default"),V=ce(()=>g(v).internals.z??0),$=ce(()=>mc(g(v)));ou(w,{get node(){return g(v)},get id(){return g(v).id},get data(){return g(v).data},get selected(){return g(E)},get hidden(){return g(S)},get draggable(){return g(x)},get selectable(){return g(P)},get connectable(){return g(N)},get deletable(){return g(O)},get positionX(){return g(v).internals.positionAbsolute.x},get positionY(){return g(v).internals.positionAbsolute.y},get isParent(){return g(T)},get style(){return g(v).style},get class(){return g(v).class},get type(){return g(L)},get sourcePosition(){return g(v).sourcePosition},get targetPosition(){return g(v).targetPosition},get dragging(){return g(v).dragging},get zIndex(){return g(V)},get dragHandle(){return g(v).dragHandle},get initialized(){return g($)},get width(){return g(v).width},get height(){return g(v).height},get initialWidth(){return g(v).initialWidth},get initialHeight(){return g(v).initialHeight},get measuredWidth(){return g(v).measured.width},get measuredHeight(){return g(v).measured.height},get parentId(){return g(v).parentId},resizeObserver:_,get nodeClickDistance(){return u()},$$events:{nodeclick(H){Ne.call(this,t,H)},nodemouseenter(H){Ne.call(this,t,H)},nodemousemove(H){Ne.call(this,t,H)},nodemouseleave(H){Ne.call(this,t,H)},nodedrag(H){Ne.call(this,t,H)},nodedragstart(H){Ne.call(this,t,H)},nodedragstop(H){Ne.call(this,t,H)},nodecontextmenu(H){Ne.call(this,t,H)}}})}),ae(C),K(e,C),de({get nodeClickDistance(){return u()},set nodeClickDistance(w){u(w),m()}})}se(iu,{nodeClickDistance:{}},[],[],!0);var D1=je('<svg><g role="img"><!></g></svg>');function su(e,t){ue(t,!1);const n=ot(),r=()=>U(F,"$edgeTypes",n),o=()=>U(ne,"$flowId",n),i=()=>U(fe,"$elementsSelectable",n),s=()=>U(G,"$edgeLookup",n),l=j(void 0,!0),u=j(void 0,!0),a=j(void 0,!0),c=j(void 0,!0),d=j(void 0,!0);let f=p(t,"id",13),h=p(t,"type",13,"default"),y=p(t,"source",13,""),_=p(t,"target",13,""),C=p(t,"data",29,()=>({})),w=p(t,"style",13,void 0),v=p(t,"zIndex",13,void 0),E=p(t,"animated",13,!1),S=p(t,"selected",13,!1),x=p(t,"selectable",13,void 0),P=p(t,"deletable",13,void 0),N=p(t,"hidden",13,!1),O=p(t,"label",13,void 0),T=p(t,"labelStyle",13,void 0),L=p(t,"markerStart",13,void 0),V=p(t,"markerEnd",13,void 0),$=p(t,"sourceHandle",13,void 0),H=p(t,"targetHandle",13,void 0),k=p(t,"sourceX",13),I=p(t,"sourceY",13),b=p(t,"targetX",13),M=p(t,"targetY",13),A=p(t,"sourcePosition",13),D=p(t,"targetPosition",13),Y=p(t,"ariaLabel",13,void 0),Z=p(t,"interactionWidth",13,void 0),Q=p(t,"class",13,"");nr("svelteflow__edge_id",f());const{edgeLookup:G,edgeTypes:F,flowId:ne,elementsSelectable:fe}=Je(),re=Lo(),Ee=Kc();function J(q){const Ye=s().get(f());Ye&&(Ee(f()),re("edgeclick",{event:q,edge:Ye}))}function te(q,Ye){const Ae=s().get(f());Ae&&re(Ye,{event:q,edge:Ae})}oe(()=>B(h()),()=>{X(l,h()||"default")}),oe(()=>(r(),g(l),yi),()=>{X(u,r()[g(l)]||yi)}),oe(()=>(B(L()),o()),()=>{X(a,L()?`url('#${$s(L(),o())}')`:void 0)}),oe(()=>(B(V()),o()),()=>{X(c,V()?`url('#${$s(V(),o())}')`:void 0)}),oe(()=>(B(x()),i()),()=>{X(d,x()??i())}),st(),me(!0);var he=at(),_e=$e(he);{var Xe=q=>{var Ye=D1(),Ae=ge(Ye);const Ge=ce(()=>Gt(dt(["svelte-flow__edge",Q()])));var He=ge(Ae),Fe=ce(()=>P()??!0);ea(He,()=>g(u),(W,Ce)=>{Ce(W,{get id(){return f()},get source(){return y()},get target(){return _()},get sourceX(){return k()},get sourceY(){return I()},get targetX(){return b()},get targetY(){return M()},get sourcePosition(){return A()},get targetPosition(){return D()},get animated(){return E()},get selected(){return S()},get label(){return O()},get labelStyle(){return T()},get data(){return C()},get style(){return w()},get interactionWidth(){return Z()},get selectable(){return g(d)},get deletable(){return g(Fe)},get type(){return g(l)},get sourceHandleId(){return $()},get targetHandleId(){return H()},get markerStart(){return g(a)},get markerEnd(){return g(c)}})}),ae(Ae),ae(Ye),pe(()=>{nt(Ye,"z-index",v()),Ln(Ae,g(Ge),""),ee(Ae,"data-id",f()),ee(Ae,"aria-label",Y()===null?void 0:Y()?Y():`Edge from ${y()} to ${_()}`),qe(Ae,"animated",E()),qe(Ae,"selected",S()),qe(Ae,"selectable",g(d))}),Be("click",Ae,J),Be("contextmenu",Ae,W=>{te(W,"edgecontextmenu")}),Be("mouseenter",Ae,W=>{te(W,"edgemouseenter")}),Be("mouseleave",Ae,W=>{te(W,"edgemouseleave")}),K(q,Ye)};We(_e,q=>{N()||q(Xe)})}return K(e,he),de({get id(){return f()},set id(q){f(q),m()},get type(){return h()},set type(q){h(q),m()},get source(){return y()},set source(q){y(q),m()},get target(){return _()},set target(q){_(q),m()},get data(){return C()},set data(q){C(q),m()},get style(){return w()},set style(q){w(q),m()},get zIndex(){return v()},set zIndex(q){v(q),m()},get animated(){return E()},set animated(q){E(q),m()},get selected(){return S()},set selected(q){S(q),m()},get selectable(){return x()},set selectable(q){x(q),m()},get deletable(){return P()},set deletable(q){P(q),m()},get hidden(){return N()},set hidden(q){N(q),m()},get label(){return O()},set label(q){O(q),m()},get labelStyle(){return T()},set labelStyle(q){T(q),m()},get markerStart(){return L()},set markerStart(q){L(q),m()},get markerEnd(){return V()},set markerEnd(q){V(q),m()},get sourceHandle(){return $()},set sourceHandle(q){$(q),m()},get targetHandle(){return H()},set targetHandle(q){H(q),m()},get sourceX(){return k()},set sourceX(q){k(q),m()},get sourceY(){return I()},set sourceY(q){I(q),m()},get targetX(){return b()},set targetX(q){b(q),m()},get targetY(){return M()},set targetY(q){M(q),m()},get sourcePosition(){return A()},set sourcePosition(q){A(q),m()},get targetPosition(){return D()},set targetPosition(q){D(q),m()},get ariaLabel(){return Y()},set ariaLabel(q){Y(q),m()},get interactionWidth(){return Z()},set interactionWidth(q){Z(q),m()},get class(){return Q()},set class(q){Q(q),m()}})}se(su,{id:{},type:{},source:{},target:{},data:{},style:{},zIndex:{},animated:{},selected:{},selectable:{},deletable:{},hidden:{},label:{},labelStyle:{},markerStart:{},markerEnd:{},sourceHandle:{},targetHandle:{},sourceX:{},sourceY:{},targetX:{},targetY:{},sourcePosition:{},targetPosition:{},ariaLabel:{},interactionWidth:{},class:{}},[],[],!0);function lu(e,t){ue(t,!1);let n=p(t,"onMount",12,void 0),r=p(t,"onDestroy",12,void 0);return sr(()=>{var o;return(o=n())==null||o(),r()}),me(),de({get onMount(){return n()},set onMount(o){n(o),m()},get onDestroy(){return r()},set onDestroy(o){r(o),m()}})}se(lu,{onMount:{},onDestroy:{}},[],[],!0);var L1=je("<defs></defs>");function au(e,t){ue(t,!1);const n=ot(),r=()=>U(o,"$markers",n),{markers:o}=Je();me();var i=L1();xn(i,5,r,s=>s.id,(s,l)=>{cu(s,In(()=>g(l)))}),ae(i),K(e,i),de()}se(au,{},[],[],!0);var I1=je('<polyline stroke-linecap="round" stroke-linejoin="round" fill="none" points="-5,-4 0,0 -5,4"></polyline>'),H1=je('<polyline stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4 -5,-4"></polyline>'),$1=je('<marker class="svelte-flow__arrowhead" viewBox="-10 -10 20 20" refX="0" refY="0"><!></marker>');function cu(e,t){ue(t,!1);let n=p(t,"id",12),r=p(t,"type",12),o=p(t,"width",12,12.5),i=p(t,"height",12,12.5),s=p(t,"markerUnits",12,"strokeWidth"),l=p(t,"orient",12,"auto-start-reverse"),u=p(t,"color",12,void 0),a=p(t,"strokeWidth",12,void 0);me();var c=$1(),d=ge(c);{var f=y=>{var _=I1();pe(()=>{ee(_,"stroke",u()),ee(_,"stroke-width",a())}),K(y,_)},h=y=>{var _=at(),C=$e(_);{var w=v=>{var E=H1();pe(()=>{ee(E,"stroke",u()),ee(E,"stroke-width",a()),ee(E,"fill",u())}),K(v,E)};We(C,v=>{r()===li.ArrowClosed&&v(w)},!0)}K(y,_)};We(d,y=>{r()===li.Arrow?y(f):y(h,!1)})}return ae(c),pe(()=>{ee(c,"id",n()),ee(c,"markerWidth",`${o()}`),ee(c,"markerHeight",`${i()}`),ee(c,"markerUnits",s()),ee(c,"orient",l())}),K(e,c),de({get id(){return n()},set id(y){n(y),m()},get type(){return r()},set type(y){r(y),m()},get width(){return o()},set width(y){o(y),m()},get height(){return i()},set height(y){i(y),m()},get markerUnits(){return s()},set markerUnits(y){s(y),m()},get orient(){return l()},set orient(y){l(y),m()},get color(){return u()},set color(y){u(y),m()},get strokeWidth(){return a()},set strokeWidth(y){a(y),m()}})}se(cu,{id:{},type:{},width:{},height:{},markerUnits:{},orient:{},color:{},strokeWidth:{}},[],[],!0);var R1=ve('<div class="svelte-flow__edges"><svg class="svelte-flow__marker"><!></svg> <!> <!></div>');function uu(e,t){ue(t,!1);const n=ot(),r=()=>U(s,"$visibleEdges",n),o=()=>U(a,"$elementsSelectable",n);let i=p(t,"defaultEdgeOptions",12);const{visibleEdges:s,edgesInitialized:l,edges:{setDefaultOptions:u},elementsSelectable:a}=Je();sr(()=>{i()&&u(i())}),me();var c=R1(),d=ge(c),f=ge(d);au(f,{}),ae(d);var h=ye(d,2);xn(h,1,r,C=>C.id,(C,w)=>{var v=ce(()=>g(w).selectable??o()),E=ce(()=>g(w).type||"default");su(C,{get id(){return g(w).id},get source(){return g(w).source},get target(){return g(w).target},get data(){return g(w).data},get style(){return g(w).style},get animated(){return g(w).animated},get selected(){return g(w).selected},get selectable(){return g(v)},get deletable(){return g(w).deletable},get hidden(){return g(w).hidden},get label(){return g(w).label},get labelStyle(){return g(w).labelStyle},get markerStart(){return g(w).markerStart},get markerEnd(){return g(w).markerEnd},get sourceHandle(){return g(w).sourceHandle},get targetHandle(){return g(w).targetHandle},get sourceX(){return g(w).sourceX},get sourceY(){return g(w).sourceY},get targetX(){return g(w).targetX},get targetY(){return g(w).targetY},get sourcePosition(){return g(w).sourcePosition},get targetPosition(){return g(w).targetPosition},get ariaLabel(){return g(w).ariaLabel},get interactionWidth(){return g(w).interactionWidth},get class(){return g(w).class},get type(){return g(E)},get zIndex(){return g(w).zIndex},$$events:{edgeclick(S){Ne.call(this,t,S)},edgecontextmenu(S){Ne.call(this,t,S)},edgemouseenter(S){Ne.call(this,t,S)},edgemouseleave(S){Ne.call(this,t,S)}}})});var y=ye(h,2);{var _=C=>{lu(C,{onMount:()=>{Ho(l,!0)},onDestroy:()=>{Ho(l,!1)}})};We(y,C=>{r().length>0&&C(_)})}return ae(c),K(e,c),de({get defaultEdgeOptions(){return i()},set defaultEdgeOptions(C){i(C),m()}})}se(uu,{defaultEdgeOptions:{}},[],[],!0);var V1=ve('<div class="svelte-flow__selection svelte-1iugwpu"></div>');const Y1={hash:"svelte-1iugwpu",code:".svelte-flow__selection.svelte-1iugwpu {position:absolute;top:0;left:0;}"};function Zs(e,t){ue(t,!1),qt(e,Y1);let n=p(t,"x",12,0),r=p(t,"y",12,0),o=p(t,"width",12,0),i=p(t,"height",12,0),s=p(t,"isVisible",12,!0);var l=at(),u=$e(l);{var a=c=>{var d=V1();pe(()=>{nt(d,"width",typeof o()=="string"?o():`${o()}px`),nt(d,"height",typeof i()=="string"?i():`${i()}px`),nt(d,"transform",`translate(${n()}px, ${r()}px)`)}),K(c,d)};We(u,c=>{s()&&c(a)})}return K(e,l),de({get x(){return n()},set x(c){n(c),m()},get y(){return r()},set y(c){r(c),m()},get width(){return o()},set width(c){o(c),m()},get height(){return i()},set height(c){i(c),m()},get isVisible(){return s()},set isVisible(c){s(c),m()}})}se(Zs,{x:{},y:{},width:{},height:{},isVisible:{}},[],[],!0);function du(e,t){ue(t,!1);const n=ot(),r=()=>U(i,"$selectionRect",n),o=()=>U(s,"$selectionRectMode",n),{selectionRect:i,selectionRectMode:s}=Je();me();var l=ce(()=>!!(r()&&o()==="user")),u=ce(()=>{var f;return(f=r())==null?void 0:f.width}),a=ce(()=>{var f;return(f=r())==null?void 0:f.height}),c=ce(()=>{var f;return(f=r())==null?void 0:f.x}),d=ce(()=>{var f;return(f=r())==null?void 0:f.y});Zs(e,{get isVisible(){return g(l)},get width(){return g(u)},get height(){return g(a)},get x(){return g(c)},get y(){return g(d)}}),de()}se(du,{},[],[],!0);var B1=ve('<div class="selection-wrapper nopan svelte-5pxri" role="button" tabindex="-1"><!></div>');const X1={hash:"svelte-5pxri",code:".selection-wrapper.svelte-5pxri {position:absolute;top:0;left:0;z-index:7;pointer-events:all;}"};function fu(e,t){ue(t,!1),qt(e,X1);const n=ot(),r=()=>U(l,"$selectionRectMode",n),o=()=>U(a,"$nodeLookup",n),i=()=>U(u,"$nodes",n),s=Je(),{selectionRectMode:l,nodes:u,nodeLookup:a}=s,c=Lo();let d=j(null);function f(w){const v=i().filter(E=>E.selected);c("selectioncontextmenu",{nodes:v,event:w})}function h(w){const v=i().filter(E=>E.selected);c("selectionclick",{nodes:v,event:w})}oe(()=>(r(),o(),i()),()=>{r()==="nodes"&&(X(d,eo(o(),{filter:w=>!!w.selected})),i())}),st(),me();var y=at(),_=$e(y);{var C=w=>{var v=B1(),E=ge(v);Zs(E,{width:"100%",height:"100%",x:0,y:0}),ae(v),ut(v,(S,x)=>wr==null?void 0:wr(S,x),()=>({disabled:!1,store:s,onDrag:(S,x,P,N)=>{c("nodedrag",{event:S,targetNode:null,nodes:N})},onDragStart:(S,x,P,N)=>{c("nodedragstart",{event:S,targetNode:null,nodes:N})},onDragStop:(S,x,P,N)=>{c("nodedragstop",{event:S,targetNode:null,nodes:N})}})),xt(()=>Be("contextmenu",v,f)),xt(()=>Be("click",v,h)),xt(()=>Be("keyup",v,()=>{})),pe(()=>ee(v,"style",`width: ${g(d).width??""}px; height: ${g(d).height??""}px; transform: translate(${g(d).x??""}px, ${g(d).y??""}px)`)),K(w,v)};We(_,w=>{r()==="nodes"&&g(d)&&an(g(d).x)&&an(g(d).y)&&w(C)})}K(e,y),de()}se(fu,{},[],[],!0);function Ie(e,t){let{enabled:n=!0,trigger:r,type:o="keydown"}=t;function i(s){const l=Array.isArray(r)?r:[r],u={alt:s.altKey,ctrl:s.ctrlKey,shift:s.shiftKey,meta:s.metaKey};for(const a of l){const c={modifier:[],preventDefault:!1,enabled:!0,...a},{modifier:d,key:f,callback:h,preventDefault:y,enabled:_}=c;if(_){if(d.length&&!(Array.isArray(d)?d:[d]).map(v=>typeof v=="string"?[v]:v).some(v=>v.every(E=>u[E])))continue;if(s.key===f){y&&s.preventDefault();const C={node:e,trigger:c,originalEvent:s};e.dispatchEvent(new CustomEvent("shortcut",{detail:C})),h==null||h(C)}}}}return n&&e.addEventListener(o,i),{update:s=>{const{enabled:l=!0,type:u="keydown"}=s;n&&(!l||o!==u)?e.removeEventListener(o,i):!n&&l&&e.addEventListener(u,i),n=l,o=u,r=s.trigger},destroy:()=>{e.removeEventListener(o,i)}}}function hu(e,t){ue(t,!1);let n=p(t,"selectionKey",12,"Shift"),r=p(t,"multiSelectionKey",28,()=>di()?"Meta":"Control"),o=p(t,"deleteKey",12,"Backspace"),i=p(t,"panActivationKey",12," "),s=p(t,"zoomActivationKey",28,()=>di()?"Meta":"Control");const{selectionKeyPressed:l,multiselectionKeyPressed:u,deleteKeyPressed:a,panActivationKeyPressed:c,zoomActivationKeyPressed:d,selectionRect:f}=Je();function h(v){return v!==null&&typeof v=="object"}function y(v){return h(v)?v.modifier||[]:[]}function _(v){return v==null?"":h(v)?v.key:v}function C(v,E){return(Array.isArray(v)?v:[v]).map(x=>{const P=_(x);return{key:P,modifier:y(x),enabled:P!==null,callback:E}})}function w(){f.set(null),l.set(!1),u.set(!1),a.set(!1),c.set(!1),d.set(!1)}return me(),Be("blur",mt,w),Be("contextmenu",mt,w),ut(mt,(v,E)=>Ie==null?void 0:Ie(v,E),()=>({trigger:C(n(),()=>l.set(!0)),type:"keydown"})),ut(mt,(v,E)=>Ie==null?void 0:Ie(v,E),()=>({trigger:C(n(),()=>l.set(!1)),type:"keyup"})),ut(mt,(v,E)=>Ie==null?void 0:Ie(v,E),()=>({trigger:C(r(),()=>u.set(!0)),type:"keydown"})),ut(mt,(v,E)=>Ie==null?void 0:Ie(v,E),()=>({trigger:C(r(),()=>u.set(!1)),type:"keyup"})),ut(mt,(v,E)=>Ie==null?void 0:Ie(v,E),()=>({trigger:C(o(),v=>{!(v.originalEvent.ctrlKey||v.originalEvent.metaKey||v.originalEvent.shiftKey)&&!E0(v.originalEvent)&&a.set(!0)}),type:"keydown"})),ut(mt,(v,E)=>Ie==null?void 0:Ie(v,E),()=>({trigger:C(o(),()=>a.set(!1)),type:"keyup"})),ut(mt,(v,E)=>Ie==null?void 0:Ie(v,E),()=>({trigger:C(i(),()=>c.set(!0)),type:"keydown"})),ut(mt,(v,E)=>Ie==null?void 0:Ie(v,E),()=>({trigger:C(i(),()=>c.set(!1)),type:"keyup"})),ut(mt,(v,E)=>Ie==null?void 0:Ie(v,E),()=>({trigger:C(s(),()=>d.set(!0)),type:"keydown"})),ut(mt,(v,E)=>Ie==null?void 0:Ie(v,E),()=>({trigger:C(s(),()=>d.set(!1)),type:"keyup"})),de({get selectionKey(){return n()},set selectionKey(v){n(v),m()},get multiSelectionKey(){return r()},set multiSelectionKey(v){r(v),m()},get deleteKey(){return o()},set deleteKey(v){o(v),m()},get panActivationKey(){return i()},set panActivationKey(v){i(v),m()},get zoomActivationKey(){return s()},set zoomActivationKey(v){s(v),m()}})}se(hu,{selectionKey:{},multiSelectionKey:{},deleteKey:{},panActivationKey:{},zoomActivationKey:{}},[],[],!0);var W1=je('<path fill="none" class="svelte-flow__connection-path"></path>'),K1=je('<svg class="svelte-flow__connectionline"><g><!><!></g></svg>');function gu(e,t){ue(t,!1);const n=ot(),r=()=>U(f,"$connection",n),o=()=>U(h,"$connectionLineType",n),i=()=>U(c,"$width",n),s=()=>U(d,"$height",n);let l=p(t,"containerStyle",12,""),u=p(t,"style",12,""),a=p(t,"isCustomComponent",12,!1);const{width:c,height:d,connection:f,connectionLineType:h}=Je();let y=j(null);oe(()=>(r(),B(a()),o(),g(y),Hs),()=>{if(r().inProgress&&!a()){const{from:v,to:E,fromPosition:S,toPosition:x}=r(),P={sourceX:v.x,sourceY:v.y,sourcePosition:S,targetX:E.x,targetY:E.y,targetPosition:x};switch(o()){case gr.Bezier:(N=>X(y,N[0]))(bc(P));break;case gr.Step:(N=>X(y,N[0]))(hi({...P,borderRadius:0}));break;case gr.SmoothStep:(N=>X(y,N[0]))(hi(P));break;default:(N=>X(y,N[0]))(Hs(P))}}}),st(),me();var _=at(),C=$e(_);{var w=v=>{var E=K1(),S=ge(E);const x=ce(()=>Gt(dt(["svelte-flow__connection",m0(r().isValid)])));var P=ge(S);et(P,t,"connectionLine",{},null);var N=ye(P);{var O=T=>{var L=W1();pe(()=>{ee(L,"d",g(y)),ee(L,"style",u())}),K(T,L)};We(N,T=>{a()||T(O)})}ae(S),ae(E),pe(()=>{ee(E,"width",i()),ee(E,"height",s()),ee(E,"style",l()),Ln(S,g(x),"")}),K(v,E)};We(C,v=>{r().inProgress&&v(w)})}return K(e,_),de({get containerStyle(){return l()},set containerStyle(v){l(v),m()},get style(){return u()},set style(v){u(v),m()},get isCustomComponent(){return a()},set isCustomComponent(v){a(v),m()}})}se(gu,{containerStyle:{},style:{},isCustomComponent:{}},["connectionLine"],[],!0);var F1=ve("<div><!></div>");function pi(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]),r=Se(n,["position","style","class"]);ue(t,!1);const o=ot(),i=()=>U(c,"$selectionRectMode",o),s=j();let l=p(t,"position",12,"top-right"),u=p(t,"style",12,void 0),a=p(t,"class",12,void 0);const{selectionRectMode:c}=Je();oe(()=>B(l()),()=>{X(s,`${l()}`.split("-"))}),st(),me();var d=F1();let f;var h=ge(d);return et(h,t,"default",{},null),ae(d),pe(()=>{f=Ut(d,f,{class:dt(["svelte-flow__panel",a(),...g(s)]),style:u(),...r}),nt(d,"pointer-events",i()?"none":"")}),K(e,d),de({get position(){return l()},set position(y){l(y),m()},get style(){return u()},set style(y){u(y),m()},get class(){return a()},set class(y){a(y),m()}})}se(pi,{position:{},style:{},class:{}},["default"],[],!0);var Z1=ve('<a href="https://svelteflow.dev" target="_blank" rel="noopener noreferrer" aria-label="Svelte Flow attribution">Svelte Flow</a>');function vu(e,t){ue(t,!1);let n=p(t,"proOptions",12,void 0),r=p(t,"position",12,"bottom-right");me();var o=at(),i=$e(o);{var s=l=>{pi(l,{get position(){return r()},class:"svelte-flow__attribution","data-message":"Feel free to remove the attribution or check out how you could support us: https://svelteflow.dev/support-us",children:(u,a)=>{var c=Z1();K(u,c)},$$slots:{default:!0}})};We(i,l=>{var u;(u=n())!=null&&u.hideAttribution||l(s)})}return K(e,o),de({get proOptions(){return n()},set proOptions(l){n(l),m()},get position(){return r()},set position(l){r(l),m()}})}se(vu,{proOptions:{},position:{}},[],[],!0);function yu(e,{nodeTypes:t,edgeTypes:n,minZoom:r,maxZoom:o,translateExtent:i,paneClickDistance:s}){t!==void 0&&e.setNodeTypes(t),n!==void 0&&e.setEdgeTypes(n),r!==void 0&&e.setMinZoom(r),o!==void 0&&e.setMaxZoom(o),i!==void 0&&e.setTranslateExtent(i),s!==void 0&&e.setPaneClickDistance(s)}const q1=e=>Object.keys(e);function mu(e,t){q1(t).forEach(n=>{const r=t[n];r!==void 0&&e[n].set(r)})}function G1(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function U1(e="light"){return Nt("light",n=>{if(e!=="system"){n(e);return}const r=G1(),o=()=>n(r!=null&&r.matches?"dark":"light");return n(r!=null&&r.matches?"dark":"light"),r==null||r.addEventListener("change",o),()=>{r==null||r.removeEventListener("change",o)}})}var j1=ve('<!> <!> <div class="svelte-flow__edgelabel-renderer"></div> <div class="svelte-flow__viewport-portal"></div> <!> <!>',1),J1=ve("<!> <!>",1),Q1=ve("<div><!> <!> <!> <!></div>");const ey={hash:"svelte-12wlba6",code:".svelte-flow.svelte-12wlba6 {width:100%;height:100%;overflow:hidden;position:relative;z-index:0;background-color:var(--background-color, var(--background-color-default));}:root {--background-color-default: #fff;--background-pattern-color-default: #ddd;--minimap-mask-color-default: rgb(240, 240, 240, 0.6);--minimap-mask-stroke-color-default: none;--minimap-mask-stroke-width-default: 1;--controls-button-background-color-default: #fefefe;--controls-button-background-color-hover-default: #f4f4f4;--controls-button-color-default: inherit;--controls-button-color-hover-default: inherit;--controls-button-border-color-default: #eee;}"};function pu(e,t){const n=Ef(t),r=Se(t,["children","$$slots","$$events","$$legacy","$$host"]),o=Se(r,["id","nodes","edges","fitView","fitViewOptions","minZoom","maxZoom","initialViewport","viewport","nodeTypes","edgeTypes","selectionKey","selectionMode","panActivationKey","multiSelectionKey","zoomActivationKey","nodesDraggable","nodesConnectable","nodeDragThreshold","elementsSelectable","snapGrid","deleteKey","connectionRadius","connectionLineType","connectionMode","connectionLineStyle","connectionLineContainerStyle","onMoveStart","onMove","onMoveEnd","isValidConnection","translateExtent","nodeExtent","onlyRenderVisibleElements","panOnScrollMode","preventScrolling","zoomOnScroll","zoomOnDoubleClick","zoomOnPinch","panOnScroll","panOnDrag","selectionOnDrag","autoPanOnConnect","autoPanOnNodeDrag","onerror","ondelete","onedgecreate","attributionPosition","proOptions","defaultEdgeOptions","width","height","colorMode","onconnect","onconnectstart","onconnectend","onbeforedelete","oninit","nodeOrigin","paneClickDistance","nodeClickDistance","defaultMarkerColor","style","class"]);ue(t,!1),qt(e,ey);const i=ot(),s=()=>U(v(),"$viewport",i),l=()=>U(go,"$initialized",i),u=()=>U(g(a),"$colorModeClass",i),a=j();let c=p(t,"id",12,"1"),d=p(t,"nodes",12),f=p(t,"edges",12),h=p(t,"fitView",12,void 0),y=p(t,"fitViewOptions",12,void 0),_=p(t,"minZoom",12,void 0),C=p(t,"maxZoom",12,void 0),w=p(t,"initialViewport",12,void 0),v=p(t,"viewport",12,void 0),E=p(t,"nodeTypes",12,void 0),S=p(t,"edgeTypes",12,void 0),x=p(t,"selectionKey",12,void 0),P=p(t,"selectionMode",12,void 0),N=p(t,"panActivationKey",12,void 0),O=p(t,"multiSelectionKey",12,void 0),T=p(t,"zoomActivationKey",12,void 0),L=p(t,"nodesDraggable",12,void 0),V=p(t,"nodesConnectable",12,void 0),$=p(t,"nodeDragThreshold",12,void 0),H=p(t,"elementsSelectable",12,void 0),k=p(t,"snapGrid",12,void 0),I=p(t,"deleteKey",12,void 0),b=p(t,"connectionRadius",12,void 0),M=p(t,"connectionLineType",12,void 0),A=p(t,"connectionMode",28,()=>Vn.Strict),D=p(t,"connectionLineStyle",12,""),Y=p(t,"connectionLineContainerStyle",12,""),Z=p(t,"onMoveStart",12,void 0),Q=p(t,"onMove",12,void 0),G=p(t,"onMoveEnd",12,void 0),F=p(t,"isValidConnection",12,void 0),ne=p(t,"translateExtent",12,void 0),fe=p(t,"nodeExtent",12,void 0),re=p(t,"onlyRenderVisibleElements",12,void 0),Ee=p(t,"panOnScrollMode",28,()=>En.Free),J=p(t,"preventScrolling",12,!0),te=p(t,"zoomOnScroll",12,!0),he=p(t,"zoomOnDoubleClick",12,!0),_e=p(t,"zoomOnPinch",12,!0),Xe=p(t,"panOnScroll",12,!1),q=p(t,"panOnDrag",12,!0),Ye=p(t,"selectionOnDrag",12,void 0),Ae=p(t,"autoPanOnConnect",12,!0),Ge=p(t,"autoPanOnNodeDrag",12,!0),He=p(t,"onerror",12,void 0),Fe=p(t,"ondelete",12,void 0),W=p(t,"onedgecreate",12,void 0),Ce=p(t,"attributionPosition",12,void 0),Ze=p(t,"proOptions",12,void 0),ft=p(t,"defaultEdgeOptions",12,void 0),ze=p(t,"width",12,void 0),Qe=p(t,"height",12,void 0),ie=p(t,"colorMode",12,"light"),De=p(t,"onconnect",12,void 0),fn=p(t,"onconnectstart",12,void 0),On=p(t,"onconnectend",12,void 0),be=p(t,"onbeforedelete",12,void 0),tt=p(t,"oninit",12,void 0),Oe=p(t,"nodeOrigin",12,void 0),rt=p(t,"paneClickDistance",12,0),_t=p(t,"nodeClickDistance",12,0),Wn=p(t,"defaultMarkerColor",12,"#b1b1b7"),ho=p(t,"style",12,void 0),Pt=p(t,"class",12,void 0),At=j(),tn=j(),ht=j();const sl=s()||w(),it=gf(mi)?Je():C1({nodes:R(d()),edges:R(f()),width:ze(),height:Qe(),fitView:h(),nodeOrigin:Oe(),nodeExtent:fe()});sr(()=>(it.width.set(g(tn)),it.height.set(g(ht)),it.domNode.set(g(At)),it.syncNodeStores(d()),it.syncEdgeStores(f()),it.syncViewport(v()),h()!==void 0&&it.fitViewOnInit.set(h()),y()&&it.fitViewOptions.set(y()),yu(it,{nodeTypes:E(),edgeTypes:S(),minZoom:_(),maxZoom:C(),translateExtent:ne(),paneClickDistance:rt()}),()=>{it.reset()}));const{initialized:go}=it;let vo=j(!1);oe(()=>(g(tn),g(ht)),()=>{g(tn)!==void 0&&g(ht)!==void 0&&(it.width.set(g(tn)),it.height.set(g(ht)))}),oe(()=>(g(vo),l(),B(tt())),()=>{var z;!g(vo)&&l()&&((z=tt())==null||z(),X(vo,!0))}),oe(()=>(B(c()),B(M()),B(b()),B(P()),B(k()),B(Wn()),B(L()),B(V()),B(H()),B(re()),B(F()),B(Ae()),B(Ge()),B(He()),B(Fe()),B(W()),B(A()),B($()),B(De()),B(fn()),B(On()),B(be()),B(Oe()),mu),()=>{const z={flowId:c(),connectionLineType:M(),connectionRadius:b(),selectionMode:P(),snapGrid:k(),defaultMarkerColor:Wn(),nodesDraggable:L(),nodesConnectable:V(),elementsSelectable:H(),onlyRenderVisibleElements:re(),isValidConnection:F(),autoPanOnConnect:Ae(),autoPanOnNodeDrag:Ge(),onerror:He(),ondelete:Fe(),onedgecreate:W(),connectionMode:A(),nodeDragThreshold:$(),onconnect:De(),onconnectstart:fn(),onconnectend:On(),onbeforedelete:be(),nodeOrigin:Oe()};mu(it,z)}),oe(()=>(B(E()),B(S()),B(_()),B(C()),B(ne()),B(rt())),()=>{yu(it,{nodeTypes:E(),edgeTypes:S(),minZoom:_(),maxZoom:C(),translateExtent:ne(),paneClickDistance:rt()})}),oe(()=>B(ie()),()=>{Tf(X(a,U1(ie())),"$colorModeClass",i)}),st(),me();var Bt=Q1();let Ai;var zi=ge(Bt);hu(zi,{get selectionKey(){return x()},get deleteKey(){return I()},get panActivationKey(){return N()},get multiSelectionKey(){return O()},get zoomActivationKey(){return T()}});var sd=ye(zi,2),$m=ce(()=>Ee()===void 0?En.Free:Ee()),Rm=ce(()=>J()===void 0?!0:J()),Vm=ce(()=>te()===void 0?!0:te()),Ym=ce(()=>he()===void 0?!0:he()),Bm=ce(()=>_e()===void 0?!0:_e()),Xm=ce(()=>Xe()===void 0?!1:Xe()),Wm=ce(()=>q()===void 0?!0:q()),Km=ce(()=>rt()===void 0?0:rt());Qc(sd,{initialViewport:sl,get onMoveStart(){return Z()},get onMove(){return Q()},get onMoveEnd(){return G()},get panOnScrollMode(){return g($m)},get preventScrolling(){return g(Rm)},get zoomOnScroll(){return g(Vm)},get zoomOnDoubleClick(){return g(Ym)},get zoomOnPinch(){return g(Bm)},get panOnScroll(){return g(Xm)},get panOnDrag(){return g(Wm)},get paneClickDistance(){return g(Km)},children:(z,np)=>{var Zm=ce(()=>q()===void 0?!0:q());nu(z,{get panOnDrag(){return g(Zm)},get selectionOnDrag(){return Ye()},$$events:{paneclick(yo){Ne.call(this,t,yo)},panecontextmenu(yo){Ne.call(this,t,yo)}},children:(yo,rp)=>{var ad=J1(),cd=$e(ad);ru(cd,{children:(Gm,op)=>{var ud=j1(),dd=$e(ud);uu(dd,{get defaultEdgeOptions(){return ft()},$$events:{edgeclick(Pe){Ne.call(this,t,Pe)},edgecontextmenu(Pe){Ne.call(this,t,Pe)},edgemouseenter(Pe){Ne.call(this,t,Pe)},edgemouseleave(Pe){Ne.call(this,t,Pe)}}});var fd=ye(dd,2);gu(fd,{get containerStyle(){return Y()},get style(){return D()},isCustomComponent:n.connectionLine,$$slots:{connectionLine:(Pe,ip)=>{var gd=at(),jm=$e(gd);et(jm,t,"connectionLine",{},null),K(Pe,gd)}}});var hd=ye(fd,6);iu(hd,{get nodeClickDistance(){return _t()},$$events:{nodeclick(Pe){Ne.call(this,t,Pe)},nodemouseenter(Pe){Ne.call(this,t,Pe)},nodemousemove(Pe){Ne.call(this,t,Pe)},nodemouseleave(Pe){Ne.call(this,t,Pe)},nodedragstart(Pe){Ne.call(this,t,Pe)},nodedrag(Pe){Ne.call(this,t,Pe)},nodedragstop(Pe){Ne.call(this,t,Pe)},nodecontextmenu(Pe){Ne.call(this,t,Pe)}}});var Um=ye(hd,2);fu(Um,{$$events:{selectionclick(Pe){Ne.call(this,t,Pe)},selectioncontextmenu(Pe){Ne.call(this,t,Pe)},nodedragstart(Pe){Ne.call(this,t,Pe)},nodedrag(Pe){Ne.call(this,t,Pe)},nodedragstop(Pe){Ne.call(this,t,Pe)}}}),K(Gm,ud)},$$slots:{default:!0}});var qm=ye(cd,2);du(qm,{}),K(yo,ad)},$$slots:{default:!0}})},$$slots:{default:!0}});var ld=ye(sd,2);vu(ld,{get proOptions(){return Ze()},get position(){return Ce()}});var Fm=ye(ld,2);return et(Fm,t,"default",{},null),ae(Bt),ir(Bt,z=>X(At,z),()=>g(At)),pe(()=>Ai=Ut(Bt,Ai,{style:ho(),class:dt(["svelte-flow",Pt(),u()]),"data-testid":"svelte-flow__wrapper",...o,role:"application"},"svelte-12wlba6")),sa(Bt,"clientWidth",z=>X(tn,z)),sa(Bt,"clientHeight",z=>X(ht,z)),Be("dragover",Bt,function(z){Ne.call(this,t,z)}),Be("drop",Bt,function(z){Ne.call(this,t,z)}),K(e,Bt),de({get id(){return c()},set id(z){c(z),m()},get nodes(){return d()},set nodes(z){d(z),m()},get edges(){return f()},set edges(z){f(z),m()},get fitView(){return h()},set fitView(z){h(z),m()},get fitViewOptions(){return y()},set fitViewOptions(z){y(z),m()},get minZoom(){return _()},set minZoom(z){_(z),m()},get maxZoom(){return C()},set maxZoom(z){C(z),m()},get initialViewport(){return w()},set initialViewport(z){w(z),m()},get viewport(){return v()},set viewport(z){v(z),m()},get nodeTypes(){return E()},set nodeTypes(z){E(z),m()},get edgeTypes(){return S()},set edgeTypes(z){S(z),m()},get selectionKey(){return x()},set selectionKey(z){x(z),m()},get selectionMode(){return P()},set selectionMode(z){P(z),m()},get panActivationKey(){return N()},set panActivationKey(z){N(z),m()},get multiSelectionKey(){return O()},set multiSelectionKey(z){O(z),m()},get zoomActivationKey(){return T()},set zoomActivationKey(z){T(z),m()},get nodesDraggable(){return L()},set nodesDraggable(z){L(z),m()},get nodesConnectable(){return V()},set nodesConnectable(z){V(z),m()},get nodeDragThreshold(){return $()},set nodeDragThreshold(z){$(z),m()},get elementsSelectable(){return H()},set elementsSelectable(z){H(z),m()},get snapGrid(){return k()},set snapGrid(z){k(z),m()},get deleteKey(){return I()},set deleteKey(z){I(z),m()},get connectionRadius(){return b()},set connectionRadius(z){b(z),m()},get connectionLineType(){return M()},set connectionLineType(z){M(z),m()},get connectionMode(){return A()},set connectionMode(z){A(z),m()},get connectionLineStyle(){return D()},set connectionLineStyle(z){D(z),m()},get connectionLineContainerStyle(){return Y()},set connectionLineContainerStyle(z){Y(z),m()},get onMoveStart(){return Z()},set onMoveStart(z){Z(z),m()},get onMove(){return Q()},set onMove(z){Q(z),m()},get onMoveEnd(){return G()},set onMoveEnd(z){G(z),m()},get isValidConnection(){return F()},set isValidConnection(z){F(z),m()},get translateExtent(){return ne()},set translateExtent(z){ne(z),m()},get nodeExtent(){return fe()},set nodeExtent(z){fe(z),m()},get onlyRenderVisibleElements(){return re()},set onlyRenderVisibleElements(z){re(z),m()},get panOnScrollMode(){return Ee()},set panOnScrollMode(z){Ee(z),m()},get preventScrolling(){return J()},set preventScrolling(z){J(z),m()},get zoomOnScroll(){return te()},set zoomOnScroll(z){te(z),m()},get zoomOnDoubleClick(){return he()},set zoomOnDoubleClick(z){he(z),m()},get zoomOnPinch(){return _e()},set zoomOnPinch(z){_e(z),m()},get panOnScroll(){return Xe()},set panOnScroll(z){Xe(z),m()},get panOnDrag(){return q()},set panOnDrag(z){q(z),m()},get selectionOnDrag(){return Ye()},set selectionOnDrag(z){Ye(z),m()},get autoPanOnConnect(){return Ae()},set autoPanOnConnect(z){Ae(z),m()},get autoPanOnNodeDrag(){return Ge()},set autoPanOnNodeDrag(z){Ge(z),m()},get onerror(){return He()},set onerror(z){He(z),m()},get ondelete(){return Fe()},set ondelete(z){Fe(z),m()},get onedgecreate(){return W()},set onedgecreate(z){W(z),m()},get attributionPosition(){return Ce()},set attributionPosition(z){Ce(z),m()},get proOptions(){return Ze()},set proOptions(z){Ze(z),m()},get defaultEdgeOptions(){return ft()},set defaultEdgeOptions(z){ft(z),m()},get width(){return ze()},set width(z){ze(z),m()},get height(){return Qe()},set height(z){Qe(z),m()},get colorMode(){return ie()},set colorMode(z){ie(z),m()},get onconnect(){return De()},set onconnect(z){De(z),m()},get onconnectstart(){return fn()},set onconnectstart(z){fn(z),m()},get onconnectend(){return On()},set onconnectend(z){On(z),m()},get onbeforedelete(){return be()},set onbeforedelete(z){be(z),m()},get oninit(){return tt()},set oninit(z){tt(z),m()},get nodeOrigin(){return Oe()},set nodeOrigin(z){Oe(z),m()},get paneClickDistance(){return rt()},set paneClickDistance(z){rt(z),m()},get nodeClickDistance(){return _t()},set nodeClickDistance(z){_t(z),m()},get defaultMarkerColor(){return Wn()},set defaultMarkerColor(z){Wn(z),m()},get style(){return ho()},set style(z){ho(z),m()},get class(){return Pt()},set class(z){Pt(z),m()}})}se(pu,{id:{},nodes:{},edges:{},fitView:{},fitViewOptions:{},minZoom:{},maxZoom:{},initialViewport:{},viewport:{},nodeTypes:{},edgeTypes:{},selectionKey:{},selectionMode:{},panActivationKey:{},multiSelectionKey:{},zoomActivationKey:{},nodesDraggable:{},nodesConnectable:{},nodeDragThreshold:{},elementsSelectable:{},snapGrid:{},deleteKey:{},connectionRadius:{},connectionLineType:{},connectionMode:{},connectionLineStyle:{},connectionLineContainerStyle:{},onMoveStart:{},onMove:{},onMoveEnd:{},isValidConnection:{},translateExtent:{},nodeExtent:{},onlyRenderVisibleElements:{},panOnScrollMode:{},preventScrolling:{},zoomOnScroll:{},zoomOnDoubleClick:{},zoomOnPinch:{},panOnScroll:{},panOnDrag:{},selectionOnDrag:{},autoPanOnConnect:{},autoPanOnNodeDrag:{},onerror:{},ondelete:{},onedgecreate:{},attributionPosition:{},proOptions:{},defaultEdgeOptions:{},width:{},height:{},colorMode:{},onconnect:{},onconnectstart:{},onconnectend:{},onbeforedelete:{},oninit:{},nodeOrigin:{},paneClickDistance:{},nodeClickDistance:{},defaultMarkerColor:{},style:{},class:{}},["connectionLine","default"],[],!0);function wu(e,t){ue(t,!1);let n=p(t,"initialNodes",12,void 0),r=p(t,"initialEdges",12,void 0),o=p(t,"initialWidth",12,void 0),i=p(t,"initialHeight",12,void 0),s=p(t,"fitView",12,void 0),l=p(t,"nodeOrigin",12,void 0);const u=Jc({nodes:n(),edges:r(),width:o(),height:i(),nodeOrigin:l(),fitView:s()});nr(mi,{getStore:()=>u}),as(()=>{u.reset()}),me();var a=at(),c=$e(a);return et(c,t,"default",{},null),K(e,a),de({get initialNodes(){return n()},set initialNodes(d){n(d),m()},get initialEdges(){return r()},set initialEdges(d){r(d),m()},get initialWidth(){return o()},set initialWidth(d){o(d),m()},get initialHeight(){return i()},set initialHeight(d){i(d),m()},get fitView(){return s()},set fitView(d){s(d),m()},get nodeOrigin(){return l()},set nodeOrigin(d){l(d),m()}})}se(wu,{initialNodes:{},initialEdges:{},initialWidth:{},initialHeight:{},fitView:{},nodeOrigin:{}},["default"],[],!0);var ty=ve("<button><!></button>");function io(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]),r=Se(n,["class"]);ue(t,!1);let o=p(t,"class",12,void 0),i,s,l,u,a;me();var c=ty();let d;var f=ge(c);return et(f,t,"default",{class:"button-svg"},null),ae(c),pe(()=>{d=Ut(c,d,{type:"button",class:dt(["svelte-flow__controls-button",o()]),...r}),nt(c,"--xy-controls-button-background-color-props",i),nt(c,"--xy-controls-button-background-color-hover-props",s),nt(c,"--xy-controls-button-color-props",l),nt(c,"--xy-controls-button-color-hover-props",u),nt(c,"--xy-controls-button-border-color-props",a)}),Be("click",c,function(h){Ne.call(this,t,h)}),K(e,c),de({get class(){return o()},set class(h){o(h),m()}})}se(io,{class:{}},["default"],[],!0);var ny=je('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"></path></svg>');function _u(e){var t=ny();K(e,t)}se(_u,{},[],[],!0);var ry=je('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 5"><path d="M0 0h32v4.2H0z"></path></svg>');function bu(e){var t=ry();K(e,t)}se(bu,{},[],[],!0);var oy=je('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 30"><path d="M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"></path></svg>');function xu(e){var t=oy();K(e,t)}se(xu,{},[],[],!0);var iy=je('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path d="M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"></path></svg>');function Cu(e){var t=iy();K(e,t)}se(Cu,{},[],[],!0);var sy=je('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path d="M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"></path></svg>');function ku(e){var t=sy();K(e,t)}se(ku,{},[],[],!0);var ly=ve("<!> <!>",1),ay=ve("<!> <!> <!> <!> <!> <!>",1);function Eu(e,t){ue(t,!1);const n=ot(),r=()=>U(M,"$nodesDraggable",n),o=()=>U(A,"$nodesConnectable",n),i=()=>U(D,"$elementsSelectable",n),s=()=>U(k,"$viewport",n),l=()=>U(I,"$minZoom",n),u=()=>U(b,"$maxZoom",n),a=j(),c=j(),d=j(),f=j();let h=p(t,"position",12,"bottom-left"),y=p(t,"showZoom",12,!0),_=p(t,"showFitView",12,!0),C=p(t,"showLock",12,!0),w=p(t,"buttonBgColor",12,void 0),v=p(t,"buttonBgColorHover",12,void 0),E=p(t,"buttonColor",12,void 0),S=p(t,"buttonColorHover",12,void 0),x=p(t,"buttonBorderColor",12,void 0),P=p(t,"ariaLabel",12,void 0),N=p(t,"style",12,void 0),O=p(t,"orientation",12,"vertical"),T=p(t,"fitViewOptions",12,void 0),L=p(t,"class",12,"");const{zoomIn:V,zoomOut:$,fitView:H,viewport:k,minZoom:I,maxZoom:b,nodesDraggable:M,nodesConnectable:A,elementsSelectable:D}=Je(),Y={bgColor:w(),bgColorHover:v(),color:E(),colorHover:S(),borderColor:x()},Z=()=>{V()},Q=()=>{$()},G=()=>{H(T())},F=()=>{X(a,!g(a)),M.set(g(a)),A.set(g(a)),D.set(g(a))};oe(()=>(r(),o(),i()),()=>{X(a,r()||o()||i())}),oe(()=>(s(),l()),()=>{X(c,s().zoom<=l())}),oe(()=>(s(),u()),()=>{X(d,s().zoom>=u())}),oe(()=>B(O()),()=>{X(f,O()==="horizontal"?"horizontal":"vertical")}),st(),me();var ne=ce(()=>dt(["svelte-flow__controls",g(f),L()])),fe=ce(()=>P()??"Svelte Flow controls");return pi(e,{get class(){return g(ne)},get position(){return h()},"data-testid":"svelte-flow__controls",get"aria-label"(){return g(fe)},get style(){return N()},children:(re,Ee)=>{var J=ay(),te=$e(J);et(te,t,"before",{},null);var he=ye(te,2);{var _e=Fe=>{var W=ly(),Ce=$e(W);io(Ce,In({class:"svelte-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",get disabled(){return g(d)}},Y,{$$events:{click:Z},children:(ft,ze)=>{_u(ft)},$$slots:{default:!0}}));var Ze=ye(Ce,2);io(Ze,In({class:"svelte-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",get disabled(){return g(c)}},Y,{$$events:{click:Q},children:(ft,ze)=>{bu(ft)},$$slots:{default:!0}})),K(Fe,W)};We(he,Fe=>{y()&&Fe(_e)})}var Xe=ye(he,2);{var q=Fe=>{io(Fe,In({class:"svelte-flow__controls-fitview",title:"fit view","aria-label":"fit view"},Y,{$$events:{click:G},children:(W,Ce)=>{xu(W)},$$slots:{default:!0}}))};We(Xe,Fe=>{_()&&Fe(q)})}var Ye=ye(Xe,2);{var Ae=Fe=>{io(Fe,In({class:"svelte-flow__controls-interactive",title:"toggle interactivity","aria-label":"toggle interactivity"},Y,{$$events:{click:F},children:(W,Ce)=>{var Ze=at(),ft=$e(Ze);{var ze=ie=>{ku(ie)},Qe=ie=>{Cu(ie)};We(ft,ie=>{g(a)?ie(ze):ie(Qe,!1)})}K(W,Ze)},$$slots:{default:!0}}))};We(Ye,Fe=>{C()&&Fe(Ae)})}var Ge=ye(Ye,2);et(Ge,t,"default",{},null);var He=ye(Ge,2);et(He,t,"after",{},null),K(re,J)},$$slots:{default:!0}}),de({get position(){return h()},set position(re){h(re),m()},get showZoom(){return y()},set showZoom(re){y(re),m()},get showFitView(){return _()},set showFitView(re){_(re),m()},get showLock(){return C()},set showLock(re){C(re),m()},get buttonBgColor(){return w()},set buttonBgColor(re){w(re),m()},get buttonBgColorHover(){return v()},set buttonBgColorHover(re){v(re),m()},get buttonColor(){return E()},set buttonColor(re){E(re),m()},get buttonColorHover(){return S()},set buttonColorHover(re){S(re),m()},get buttonBorderColor(){return x()},set buttonBorderColor(re){x(re),m()},get ariaLabel(){return P()},set ariaLabel(re){P(re),m()},get style(){return N()},set style(re){N(re),m()},get orientation(){return O()},set orientation(re){O(re),m()},get fitViewOptions(){return T()},set fitViewOptions(re){T(re),m()},get class(){return L()},set class(re){L(re),m()}})}se(Eu,{position:{},showZoom:{},showFitView:{},showLock:{},buttonBgColor:{},buttonBgColorHover:{},buttonColor:{},buttonColorHover:{},buttonBorderColor:{},ariaLabel:{},style:{},orientation:{},fitViewOptions:{},class:{}},["before","default","after"],[],!0);var Pn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Pn||(Pn={}));var cy=je("<circle></circle>");function Su(e,t){ue(t,!1);let n=p(t,"radius",12,5),r=p(t,"class",12,"");me();var o=cy();const i=ce(()=>Gt(dt(["svelte-flow__background-pattern","dots",r()])));return pe(()=>{ee(o,"cx",n()),ee(o,"cy",n()),ee(o,"r",n()),Ln(o,g(i),"")}),K(e,o),de({get radius(){return n()},set radius(s){n(s),m()},get class(){return r()},set class(s){r(s),m()}})}se(Su,{radius:{},class:{}},[],[],!0);var uy=je("<path></path>");function Pu(e,t){ue(t,!1);let n=p(t,"lineWidth",12,1),r=p(t,"dimensions",12),o=p(t,"variant",12,void 0),i=p(t,"class",12,"");me();var s=uy();const l=ce(()=>Gt(dt(["svelte-flow__background-pattern",o(),i()])));return pe(()=>{ee(s,"stroke-width",n()),ee(s,"d",`M${r()[0]/2} 0 V${r()[1]} M0 ${r()[1]/2} H${r()[0]}`),Ln(s,g(l),"")}),K(e,s),de({get lineWidth(){return n()},set lineWidth(u){n(u),m()},get dimensions(){return r()},set dimensions(u){r(u),m()},get variant(){return o()},set variant(u){o(u),m()},get class(){return i()},set class(u){i(u),m()}})}se(Pu,{lineWidth:{},dimensions:{},variant:{},class:{}},[],[],!0);const dy={[Pn.Dots]:1,[Pn.Lines]:1,[Pn.Cross]:6};var fy=je('<svg data-testid="svelte-flow__background"><pattern patternUnits="userSpaceOnUse"><!></pattern><rect x="0" y="0" width="100%" height="100%"></rect></svg>');const hy={hash:"svelte-1r7pe8d",code:".svelte-flow__background.svelte-1r7pe8d {position:absolute;width:100%;height:100%;top:0;left:0;}"};function Mu(e,t){ue(t,!1),qt(e,hy);const n=ot(),r=()=>U(S,"$flowId",n),o=()=>U(E,"$viewport",n),i=j(),s=j(),l=j(),u=j(),a=j();let c=p(t,"id",12,void 0),d=p(t,"variant",28,()=>Pn.Dots),f=p(t,"gap",12,20),h=p(t,"size",12,1),y=p(t,"lineWidth",12,1),_=p(t,"bgColor",12,void 0),C=p(t,"patternColor",12,void 0),w=p(t,"patternClass",12,void 0),v=p(t,"class",12,"");const{viewport:E,flowId:S}=Je(),x=h()||dy[d()],P=d()===Pn.Dots,N=d()===Pn.Cross,O=Array.isArray(f())?f():[f(),f()];oe(()=>(r(),B(c())),()=>{X(i,`background-pattern-${r()}-${c()?c():""}`)}),oe(()=>o(),()=>{X(s,[O[0]*o().zoom||1,O[1]*o().zoom||1])}),oe(()=>o(),()=>{X(l,x*o().zoom)}),oe(()=>(g(l),g(s)),()=>{X(u,N?[g(l),g(l)]:g(s))}),oe(()=>(g(l),g(u)),()=>{X(a,P?[g(l)/2,g(l)/2]:[g(u)[0]/2,g(u)[1]/2])}),st(),me();var T=fy();const L=ce(()=>Gt(dt(["svelte-flow__background",v()])));var V=ge(T),$=ge(V);{var H=b=>{var M=ce(()=>g(l)/2);Su(b,{get radius(){return g(M)},get class(){return w()}})},k=b=>{Pu(b,{get dimensions(){return g(u)},get variant(){return d()},get lineWidth(){return y()},get class(){return w()}})};We($,b=>{P?b(H):b(k,!1)})}ae(V);var I=ye(V);return ae(T),pe(()=>{Ln(T,g(L),"svelte-1r7pe8d"),nt(T,"--xy-background-color-props",_()),nt(T,"--xy-background-pattern-color-props",C()),ee(V,"id",g(i)),ee(V,"x",o().x%g(s)[0]),ee(V,"y",o().y%g(s)[1]),ee(V,"width",g(s)[0]),ee(V,"height",g(s)[1]),ee(V,"patternTransform",`translate(-${g(a)[0]},-${g(a)[1]})`),ee(I,"fill",`url(#${g(i)})`)}),K(e,T),de({get id(){return c()},set id(b){c(b),m()},get variant(){return d()},set variant(b){d(b),m()},get gap(){return f()},set gap(b){f(b),m()},get size(){return h()},set size(b){h(b),m()},get lineWidth(){return y()},set lineWidth(b){y(b),m()},get bgColor(){return _()},set bgColor(b){_(b),m()},get patternColor(){return C()},set patternColor(b){C(b),m()},get patternClass(){return w()},set patternClass(b){w(b),m()},get class(){return v()},set class(b){v(b),m()}})}se(Mu,{id:{},variant:{},gap:{},size:{},lineWidth:{},bgColor:{},patternColor:{},patternClass:{},class:{}},[],[],!0);var gy=je("<rect></rect>");function Nu(e,t){ue(t,!1);let n=p(t,"x",12),r=p(t,"y",12),o=p(t,"width",12,0),i=p(t,"height",12,0),s=p(t,"borderRadius",12,5),l=p(t,"color",12,void 0),u=p(t,"shapeRendering",12),a=p(t,"strokeColor",12,void 0),c=p(t,"strokeWidth",12,2),d=p(t,"selected",12,!1),f=p(t,"class",12,"");me();var h=gy();const y=ce(()=>Gt(dt(["svelte-flow__minimap-node",f()])));return pe(()=>{Ln(h,g(y),""),ee(h,"x",n()),ee(h,"y",r()),ee(h,"rx",s()),ee(h,"ry",s()),ee(h,"width",o()),ee(h,"height",i()),ee(h,"style",`${l()?`fill: ${l()};`:""}${a()?`stroke: ${a()};`:""}${c()?`stroke-width: ${c()};`:""}`),ee(h,"shape-rendering",u()),qe(h,"selected",d())}),K(e,h),de({get x(){return n()},set x(_){n(_),m()},get y(){return r()},set y(_){r(_),m()},get width(){return o()},set width(_){o(_),m()},get height(){return i()},set height(_){i(_),m()},get borderRadius(){return s()},set borderRadius(_){s(_),m()},get color(){return l()},set color(_){l(_),m()},get shapeRendering(){return u()},set shapeRendering(_){u(_),m()},get strokeColor(){return a()},set strokeColor(_){a(_),m()},get strokeWidth(){return c()},set strokeWidth(_){c(_),m()},get selected(){return d()},set selected(_){d(_),m()},get class(){return f()},set class(_){f(_),m()}})}se(Nu,{x:{},y:{},width:{},height:{},borderRadius:{},color:{},shapeRendering:{},strokeColor:{},strokeWidth:{},selected:{},class:{}},[],[],!0);function qs(e,t){const n=J0({domNode:e,panZoom:t.panZoom,getTransform:()=>{const o=R(t.viewport);return[o.x,o.y,o.zoom]},getViewScale:t.getViewScale});function r(o){n.update({translateExtent:o.translateExtent,width:o.width,height:o.height,inversePan:o.inversePan,zoomStep:o.zoomStep,pannable:o.pannable,zoomable:o.zoomable})}return{update:r,destroy(){n.destroy()}}}const Gs=e=>e instanceof Function?e:()=>e;var vy=ve("<title> </title>"),yy=je('<svg class="svelte-flow__minimap-svg" role="img"><!><!><path class="svelte-flow__minimap-mask" fill-rule="evenodd" pointer-events="none"></path></svg>');function Ou(e,t){ue(t,!1);const n=ot(),r=()=>U(q,"$flowId",n),o=()=>U(he,"$viewport",n),i=()=>U(_e,"$containerWidth",n),s=()=>U(Xe,"$containerHeight",n),l=()=>U(te,"$nodeLookup",n),u=()=>U(J,"$nodes",n),a=()=>U(Ye,"$panZoom",n),c=()=>U(Ae,"$translateExtent",n),d=j(),f=j(),h=j(),y=j(),_=j(),C=j(),w=j(),v=j(),E=j(),S=j(),x=j(),P=j(),N=j();let O=p(t,"position",12,"bottom-right"),T=p(t,"ariaLabel",12,"Mini map"),L=p(t,"nodeStrokeColor",12,"transparent"),V=p(t,"nodeColor",12,void 0),$=p(t,"nodeClass",12,""),H=p(t,"nodeBorderRadius",12,5),k=p(t,"nodeStrokeWidth",12,2),I=p(t,"bgColor",12,void 0),b=p(t,"maskColor",12,void 0),M=p(t,"maskStrokeColor",12,void 0),A=p(t,"maskStrokeWidth",12,void 0),D=p(t,"width",12,void 0),Y=p(t,"height",12,void 0),Z=p(t,"pannable",12,!0),Q=p(t,"zoomable",12,!0),G=p(t,"inversePan",12,void 0),F=p(t,"zoomStep",12,void 0),ne=p(t,"style",12,""),fe=p(t,"class",12,"");const re=200,Ee=150,{nodes:J,nodeLookup:te,viewport:he,width:_e,height:Xe,flowId:q,panZoom:Ye,translateExtent:Ae}=Je(),Ge=V()===void 0?void 0:Gs(V()),He=Gs(L()),Fe=Gs($()),W=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",Ce=`svelte-flow__minimap-desc-${r()}`;let Ze=j(g(d));const ft=()=>g(C);oe(()=>(o(),i(),s()),()=>{X(d,{x:-o().x/o().zoom,y:-o().y/o().zoom,width:i()/o().zoom,height:s()/o().zoom})}),oe(()=>(l(),g(d),u()),()=>{X(Ze,l().size>0?hc(eo(l()),g(d)):g(d)),u()}),oe(()=>B(D()),()=>{X(f,D()??re)}),oe(()=>B(Y()),()=>{X(h,Y()??Ee)}),oe(()=>(g(Ze),g(f)),()=>{X(y,g(Ze).width/g(f))}),oe(()=>(g(Ze),g(h)),()=>{X(_,g(Ze).height/g(h))}),oe(()=>(g(y),g(_)),()=>{X(C,Math.max(g(y),g(_)))}),oe(()=>(g(C),g(f)),()=>{X(w,g(C)*g(f))}),oe(()=>(g(C),g(h)),()=>{X(v,g(C)*g(h))}),oe(()=>g(C),()=>{X(E,5*g(C))}),oe(()=>(g(Ze),g(w),g(E)),()=>{X(S,g(Ze).x-(g(w)-g(Ze).width)/2-g(E))}),oe(()=>(g(Ze),g(v),g(E)),()=>{X(x,g(Ze).y-(g(v)-g(Ze).height)/2-g(E))}),oe(()=>(g(w),g(E)),()=>{X(P,g(w)+g(E)*2)}),oe(()=>(g(v),g(E)),()=>{X(N,g(v)+g(E)*2)}),st(),me();var ze=ce(()=>ne()+(I()?`;--xy-minimap-background-color-props:${I()}`:"")),Qe=ce(()=>dt(["svelte-flow__minimap",fe()]));return pi(e,{get position(){return O()},get style(){return g(ze)},get class(){return g(Qe)},"data-testid":"svelte-flow__minimap",children:(ie,De)=>{var fn=at(),On=$e(fn);{var be=tt=>{var Oe=yy();ee(Oe,"aria-labelledby",Ce);var rt=ge(Oe);{var _t=Pt=>{var At=vy();ee(At,"id",Ce);var tn=ge(At,!0);ae(At),pe(()=>bn(tn,T())),K(Pt,At)};We(rt,Pt=>{T()&&Pt(_t)})}var Wn=ye(rt);xn(Wn,1,u,Pt=>Pt.id,(Pt,At)=>{var tn=at();const ht=ce(()=>l().get(g(At).id));var sl=$e(tn);{var it=go=>{const vo=ce(()=>Sn(g(ht)));var Bt=ce(()=>Ge==null?void 0:Ge(g(ht))),Ai=ce(()=>He(g(ht))),zi=ce(()=>Fe(g(ht)));Nu(go,In({get x(){return g(ht).internals.positionAbsolute.x},get y(){return g(ht).internals.positionAbsolute.y}},()=>g(vo),{get selected(){return g(ht).selected},get color(){return g(Bt)},get borderRadius(){return H()},get strokeColor(){return g(Ai)},get strokeWidth(){return k()},shapeRendering:W,get class(){return g(zi)}}))};We(sl,go=>{g(ht)&&mc(g(ht))&&go(it)})}K(Pt,tn)});var ho=ye(Wn);ae(Oe),ut(Oe,(Pt,At)=>qs==null?void 0:qs(Pt,At),()=>({panZoom:a(),viewport:he,getViewScale:ft,translateExtent:c(),width:i(),height:s(),inversePan:G(),zoomStep:F(),pannable:Z(),zoomable:Q()})),pe(()=>{ee(Oe,"width",g(f)),ee(Oe,"height",g(h)),ee(Oe,"viewBox",`${g(S)??""} ${g(x)??""} ${g(P)??""} ${g(N)??""}`),nt(Oe,"--xy-minimap-mask-background-color-props",b()),nt(Oe,"--xy-minimap-mask-stroke-color-props",M()),nt(Oe,"--xy-minimap-mask-stroke-width-props",A()?A()*g(C):void 0),ee(ho,"d",`M${g(S)-g(E)},${g(x)-g(E)}h${g(P)+g(E)*2}v${g(N)+g(E)*2}h${-g(P)-g(E)*2}z
      M${g(d).x??""},${g(d).y??""}h${g(d).width??""}v${g(d).height??""}h${-g(d).width}z`)}),K(tt,Oe)};We(On,tt=>{a()&&tt(be)})}K(ie,fn)},$$slots:{default:!0}}),de({get position(){return O()},set position(ie){O(ie),m()},get ariaLabel(){return T()},set ariaLabel(ie){T(ie),m()},get nodeStrokeColor(){return L()},set nodeStrokeColor(ie){L(ie),m()},get nodeColor(){return V()},set nodeColor(ie){V(ie),m()},get nodeClass(){return $()},set nodeClass(ie){$(ie),m()},get nodeBorderRadius(){return H()},set nodeBorderRadius(ie){H(ie),m()},get nodeStrokeWidth(){return k()},set nodeStrokeWidth(ie){k(ie),m()},get bgColor(){return I()},set bgColor(ie){I(ie),m()},get maskColor(){return b()},set maskColor(ie){b(ie),m()},get maskStrokeColor(){return M()},set maskStrokeColor(ie){M(ie),m()},get maskStrokeWidth(){return A()},set maskStrokeWidth(ie){A(ie),m()},get width(){return D()},set width(ie){D(ie),m()},get height(){return Y()},set height(ie){Y(ie),m()},get pannable(){return Z()},set pannable(ie){Z(ie),m()},get zoomable(){return Q()},set zoomable(ie){Q(ie),m()},get inversePan(){return G()},set inversePan(ie){G(ie),m()},get zoomStep(){return F()},set zoomStep(ie){F(ie),m()},get style(){return ne()},set style(ie){ne(ie),m()},get class(){return fe()},set class(ie){fe(ie),m()}})}se(Ou,{position:{},ariaLabel:{},nodeStrokeColor:{},nodeColor:{},nodeClass:{},nodeBorderRadius:{},nodeStrokeWidth:{},bgColor:{},maskColor:{},maskStrokeColor:{},maskStrokeWidth:{},width:{},height:{},pannable:{},zoomable:{},inversePan:{},zoomStep:{},style:{},class:{}},[],[],!0);const Tu=e=>w0(e);function my(){const{zoomIn:e,zoomOut:t,fitView:n,onbeforedelete:r,snapGrid:o,viewport:i,width:s,height:l,minZoom:u,maxZoom:a,panZoom:c,nodes:d,edges:f,domNode:h,nodeLookup:y,nodeOrigin:_,edgeLookup:C,connectionLookup:w}=Je(),v=x=>{var L,V;const P=R(y),N=Tu(x)?x:P.get(x.id),O=N.parentId?x0(N.position,N.measured,N.parentId,P,R(_)):N.position,T={...N,position:O,width:((L=N.measured)==null?void 0:L.width)??N.width,height:((V=N.measured)==null?void 0:V.height)??N.height};return yr(T)},E=(x,P,N={replace:!1})=>{var L;const O=(L=R(y).get(x))==null?void 0:L.internals.userNode;if(!O)return;const T=typeof P=="function"?P(O):P;N.replace?d.update(V=>V.map($=>$.id===x?Tu(T)?T:{...$,...T}:$)):(Object.assign(O,T),d.update(V=>V))},S=x=>R(y).get(x);return{zoomIn:e,zoomOut:t,getInternalNode:S,getNode:x=>{var P;return(P=S(x))==null?void 0:P.internals.userNode},getNodes:x=>x===void 0?R(d):Au(R(y),x),getEdge:x=>R(C).get(x),getEdges:x=>x===void 0?R(f):Au(R(C),x),setZoom:(x,P)=>{const N=R(c);return N?N.scaleTo(x,{duration:P==null?void 0:P.duration}):Promise.resolve(!1)},getZoom:()=>R(i).zoom,setViewport:async(x,P)=>{const N=R(i),O=R(c);return O?(await O.setViewport({x:x.x??N.x,y:x.y??N.y,zoom:x.zoom??N.zoom},{duration:P==null?void 0:P.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>R(i),setCenter:async(x,P,N)=>{const O=typeof(N==null?void 0:N.zoom)<"u"?N.zoom:R(a),T=R(c);return T?(await T.setViewport({x:R(s)/2-x*O,y:R(l)/2-P*O,zoom:O},{duration:N==null?void 0:N.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitView:n,fitBounds:async(x,P)=>{const N=R(c);if(!N)return Promise.resolve(!1);const O=Ds(x,R(s),R(l),R(u),R(a),(P==null?void 0:P.padding)??.1);return await N.setViewport(O,{duration:P==null?void 0:P.duration}),Promise.resolve(!0)},getIntersectingNodes:(x,P=!0,N)=>{const O=gc(x),T=O?x:v(x);return T?(N||R(d)).filter(L=>{const V=R(y).get(L.id);if(!V||!O&&L.id===x.id)return!1;const $=yr(V),H=to($,T);return P&&H>0||H>=T.width*T.height}):[]},isNodeIntersecting:(x,P,N=!0)=>{const T=gc(x)?x:v(x);if(!T)return!1;const L=to(T,P);return N&&L>0||L>=T.width*T.height},deleteElements:async({nodes:x=[],edges:P=[]})=>{const{nodes:N,edges:O}=await cc({nodesToRemove:x,edgesToRemove:P,nodes:R(d),edges:R(f),onBeforeDelete:R(r)});return N&&d.update(T=>T.filter(L=>!N.some(({id:V})=>V===L.id))),O&&f.update(T=>T.filter(L=>!O.some(({id:V})=>V===L.id))),{deletedNodes:N,deletedEdges:O}},screenToFlowPosition:(x,P={snapToGrid:!0})=>{const N=R(h);if(!N)return x;const O=P.snapToGrid?R(o):!1,{x:T,y:L,zoom:V}=R(i),{x:$,y:H}=N.getBoundingClientRect(),k={x:x.x-$,y:x.y-H};return no(k,[T,L,V],O!==null,O||[1,1])},flowToScreenPosition:x=>{const P=R(h);if(!P)return x;const{x:N,y:O,zoom:T}=R(i),{x:L,y:V}=P.getBoundingClientRect(),$=yc(x,[N,O,T]);return{x:$.x+L,y:$.y+V}},toObject:()=>({nodes:R(d).map(x=>({...x,position:{...x.position},data:{...x.data}})),edges:R(f).map(x=>({...x})),viewport:{...R(i)}}),updateNode:E,updateNodeData:(x,P,N)=>{var L;const O=(L=R(y).get(x))==null?void 0:L.internals.userNode;if(!O)return;const T=typeof P=="function"?P(O):P;O.data=N!=null&&N.replace?T:{...O.data,...T},d.update(V=>V)},getNodesBounds:x=>{const P=R(y),N=R(_);return _0(x,{nodeLookup:P,nodeOrigin:N})},getHandleConnections:({type:x,id:P,nodeId:N})=>{var O;return Array.from(((O=R(w).get(`${N}-${x}-${P??null}`))==null?void 0:O.values())??[])},viewport:i}}function Au(e,t){var r;const n=[];for(const o of t){const i=e.get(o);if(i){const s="internals"in i?(r=i.internals)==null?void 0:r.userNode:i;n.push(s)}}return n}const py="tinyflow-component";class wy{constructor(t){gt(this,"options");gt(this,"rootEl");gt(this,"svelteFlowInstance");this._setOptions(t),this._init()}_init(){if(typeof this.options.element=="string"){if(this.rootEl=document.querySelector(this.options.element),!this.rootEl)throw new Error("element not found by document.querySelector('"+this.options.element+"')")}else if(this.options.element instanceof Element)this.rootEl=this.options.element;else throw new Error("element must be a string or Element");const t=document.createElement(py);t.data=this.options.data,t.onInit=n=>{this.svelteFlowInstance=n},t.style.display="block",t.style.width="100%",t.style.height="100%",t.classList.add("tf-theme-light"),this.rootEl.appendChild(t)}_setOptions(t){this.options={...t}}getOptions(){return this.options}getData(){return this.svelteFlowInstance.toObject()}}const wi=(()=>{const e=le([]),t=le([]),n=le({x:250,y:100,zoom:1});return{nodes:e,edges:t,viewport:n,init:(r,o)=>{e.set(r),t.set(o)},addNode:r=>{e.update(o=>[...o,r])},removeNode:r=>{e.update(o=>o.filter(i=>i.id!==r))},updateNode:(r,o)=>{e.update(i=>i.map(s=>s.id===r?o:s))},updateNodeData:(r,o)=>{e.update(i=>i.map(s=>s.id===r?{...s,data:o}:s))},selectNodeOnly:r=>{e.update(o=>o.map(i=>i.id===r?{...i,selected:!0}:{...i,selected:!1}))},addEdge:r=>{t.update(o=>[...o,r])},removeEdge:r=>{t.update(o=>o.filter(i=>i.id!==r))},updateEdge:(r,o)=>{t.update(i=>i.map(s=>s.id===r?o:s))},updateEdgeData:(r,o)=>{t.update(i=>i.map(s=>s.id===r?{...s,data:o}:s))}}})();var _y=ve("<!> <!> <!>",1),by=ve('<div class="tf-node-wrapper"><div class="tf-node-wrapper-title"><!></div> <div class="tf-node-wrapper-body"><!></div></div> <!>',1);function _i(e,t){ue(t,!1),me();var n=by(),r=$e(n),o=ge(r),i=ge(o);et(i,t,"header",{},a=>{var c=Yr("TinyFlow");K(a,c)}),ae(o);var s=ye(o,2),l=ge(s);et(l,t,"default",{},null),ae(s),ae(r);var u=ye(r,2);et(u,t,"handlers",{},a=>{var c=_y(),d=$e(c);Bn(d,{type:"target",get position(){return we.Left},style:" left: -10px;top: 20px"});var f=ye(d,2);Bn(f,{type:"source",get position(){return we.Right},style:"right: -10px;top: 20px"});var h=ye(f,2);et(h,t,"handlers-append",{},null),K(a,c)}),K(e,n),de()}se(_i,{},["header","default","handlers","handlers-append"],[],!0);let xy=Symbol("nodeProps");function Us(e){nr(xy,e)}var Cy=ve("<button><!></button>");function bi(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]),r=Se(n,[]);ue(t,!1),me();var o=Cy();let i;var s=ge(o);et(s,t,"default",{},null),ae(o),pe(()=>i=Ut(o,i,{type:"button",...r,class:`tf-btn ${r.class??""}`})),K(e,o),de()}se(bi,{},["default"],[],!0);var ky=ve("<input>");function zu(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]),r=Se(n,[]);ue(t,!1),me();var o=ky();na(o);let i;pe(()=>i=Ut(o,i,{type:"checkbox",...r,class:`tf-checkbox ${r.class??""}`})),K(e,o),de()}se(zu,{},[],[],!0);var Ey=ve("<input>");function xi(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]),r=Se(n,[]);ue(t,!1),me();var o=Ey();na(o);let i;pe(()=>i=Ut(o,i,{type:"text",...r,class:`tf-input ${r.class??""}`})),K(e,o),de()}se(xi,{},[],[],!0);var Sy=ve("<textarea></textarea>");function Du(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]),r=Se(n,[]);ue(t,!1),me();var o=Sy();mf(o);let i;pe(()=>i=Ut(o,i,{...r,class:`tf-textarea nodrag ${r.class??""}`})),K(e,o),de()}se(Du,{},[],[],!0);var Py=ve('<div role="button"><!></div>'),My=ve("<div></div>");function Lu(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]),r=Se(n,["items","onChange","activeIndex"]);ue(t,!1);let o=p(t,"items",28,()=>[]),i=p(t,"onChange",12,()=>{}),s=p(t,"activeIndex",12,0);function l(c,d){var f;s(d),(f=i())==null||f(c,d)}me();var u=My();let a;return xn(u,5,o,zo,(c,d,f)=>{var h=Py();ee(h,"tabindex",f),h.__click=()=>l(g(d),f),h.__keydown=w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),l(g(d),f))};var y=ge(h);{var _=w=>{var v=Yr();pe(()=>bn(v,g(d).label)),K(w,v)},C=w=>{var v=at(),E=$e(v);Do(E,()=>g(d).label??Mt),K(w,v)};We(y,w=>{typeof g(d).label=="string"?w(_):w(C,!1)})}ae(h),pe(()=>or(h,`tf-tabs-item ${(f===s()?"active":"")??""}`)),K(c,h)}),ae(u),pe(()=>a=Ut(u,a,{...r,class:`tf-tabs ${r.class??""}`})),K(e,u),de({get items(){return o()},set items(c){o(c),m()},get onChange(){return i()},set onChange(c){i(c),m()},get activeIndex(){return s()},set activeIndex(c){s(c),m()}})}Ao(["click","keydown"]),se(Lu,{items:{},onChange:{},activeIndex:{}},[],[],!0);var Ny=(e,t,n)=>t(g(n)),Oy=(e,t,n)=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),t(g(n)))},Ty=ve('<div class="tf-collapse-item-description"><!></div>'),Ay=ve('<div class="tf-collapse-item-content"><!></div>'),zy=ve('<div class="tf-collapse-item"><div class="tf-collapse-item-title" role="button"><span class="tf-collapse-item-title-icon"><!></span> <!> <span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"></path></svg></span></div> <!> <!></div>'),Dy=ve("<div></div>");const Ly={hash:"svelte-1jfktzw",code:`
    /* 定义旋转的 CSS 类 */.rotate-90.svelte-1jfktzw {transform:rotate(90deg);transition:transform 0.3s ease;}`};function Ci(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]),r=Se(n,["items","onChange","activeKeys"]);ue(t,!1),qt(e,Ly);let o=p(t,"items",28,()=>[]),i=p(t,"onChange",12,()=>{}),s=p(t,"activeKeys",28,()=>[]);function l(a){var c;s().includes(a.key)?s(s().filter(d=>d!==a.key)):(s().push(a.key),s(s())),(c=i())==null||c(a)}me();var u=Dy();return xn(u,5,o,zo,(a,c,d)=>{var f=zy(),h=ge(f);ee(h,"tabindex",d),h.__click=[Ny,l,c],h.__keydown=[Oy,l,c];var y=ge(h),_=ge(y);Ql(_,()=>g(c).icon),ae(y);var C=ye(y,2);_r(C,{get target(){return g(c).title}});var w=ye(C,2);const v=ce(()=>`tf-collapse-item-title-arrow ${(s().includes(g(c).key)?"rotate-90":"")??""} svelte-1jfktzw`);ae(h);var E=ye(h,2);{var S=N=>{var O=Ty(),T=ge(O);_r(T,{get target(){return g(c).description}}),ae(O),K(N,O)};We(E,N=>{g(c).description&&N(S)})}var x=ye(E,2);{var P=N=>{var O=Ay(),T=ge(O);_r(T,{get target(){return g(c).content}}),ae(O),K(N,O)};We(x,N=>{s().includes(g(c).key)&&N(P)})}ae(f),pe(()=>or(w,g(v))),K(a,f)}),ae(u),pe(()=>{ee(u,"style",n.style),or(u,`tf-collapse ${r.class??""} svelte-1jfktzw`)}),K(e,u),de({get items(){return o()},set items(a){o(a),m()},get onChange(){return i()},set onChange(a){i(a),m()},get activeKeys(){return s()},set activeKeys(a){s(a),m()}})}Ao(["click","keydown"]),se(Ci,{items:{},onChange:{},activeKeys:{}},[],[],!0);function _r(e,t){ue(t,!0);let n=p(t,"target",7);var r=at(),o=$e(r);{var i=l=>{var u=at(),a=$e(u);Do(a,()=>n()??Mt),K(l,u)},s=l=>{var u=Yr();pe(()=>bn(u,n())),K(l,u)};We(o,l=>{typeof n()=="function"?l(i):l(s,!1)})}return K(e,r),de({get target(){return n()},set target(l){n(l),m()}})}se(_r,{target:{}},[],[],!0);var Iy=ve('<button class="tf-select-content-item"><!></button>'),Hy=ve('<div class="tf-select-content"></div>'),$y=ve('<button><div class="tf-select-input-value"><!></div> <div class="tf-select-input-arrow"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"></path></svg></div></button>'),Ry=ve("<div><!></div>");function Iu(e,t){const n=Se(t,["children","$$slots","$$events","$$legacy","$$host"]),r=Se(n,["items","onChange","activeIndex"]);ue(t,!1);let o=p(t,"items",28,()=>[]),i=p(t,"onChange",12,()=>{}),s=p(t,"activeIndex",12,0),l=j();function u(f,h){var y,_;s(h),(y=i())==null||y(f,h),(_=g(l))==null||_.hide()}me();var a=Ry();let c;var d=ge(a);return ir(Qu(d,{floating:h=>{var y=Hy();xn(y,5,o,zo,(_,C,w)=>{var v=Iy();v.__click=()=>u(g(C),w);var E=ge(v);_r(E,{get target(){return g(C).label}}),ae(v),K(_,v)}),ae(y),K(h,y)},children:(h,y)=>{var _=$y();let C;var w=ge(_),v=ge(w),E=ce(()=>{var S;return(S=o()[s()])==null?void 0:S.label});_r(v,{get target(){return g(E)}}),ae(w),zr(2),ae(_),pe(()=>C=Ut(_,C,{class:"tf-select-input",...r})),K(h,_)},$$slots:{floating:!0,default:!0},$$legacy:!0}),h=>X(l,h),()=>g(l)),ae(a),pe(()=>c=Ut(a,c,{...r,class:`tf-select ${r.class??""}`})),K(e,a),de({get items(){return o()},set items(f){o(f),m()},get onChange(){return i()},set onChange(f){i(f),m()},get activeIndex(){return s()},set activeIndex(f){s(f),m()}})}Ao(["click"]),se(Iu,{items:{},onChange:{},activeIndex:{}},[],[],!0);const so=Math.min,br=Math.max,ki=Math.round,Qt=e=>({x:e,y:e}),Vy={left:"right",right:"left",bottom:"top",top:"bottom"},Yy={start:"end",end:"start"};function js(e,t,n){return br(e,so(t,n))}function lo(e,t){return typeof e=="function"?e(t):e}function Xn(e){return e.split("-")[0]}function ao(e){return e.split("-")[1]}function Hu(e){return e==="x"?"y":"x"}function Js(e){return e==="y"?"height":"width"}function xr(e){return["top","bottom"].includes(Xn(e))?"y":"x"}function Qs(e){return Hu(xr(e))}function By(e,t,n){n===void 0&&(n=!1);const r=ao(e),o=Qs(e),i=Js(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ei(s)),[s,Ei(s)]}function Xy(e){const t=Ei(e);return[el(e),t,el(t)]}function el(e){return e.replace(/start|end/g,t=>Yy[t])}function Wy(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function Ky(e,t,n,r){const o=ao(e);let i=Wy(Xn(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(el)))),i}function Ei(e){return e.replace(/left|right|bottom|top/g,t=>Vy[t])}function Fy(e){return{top:0,right:0,bottom:0,left:0,...e}}function $u(e){return typeof e!="number"?Fy(e):{top:e,right:e,bottom:e,left:e}}function Si(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ru(e,t,n){let{reference:r,floating:o}=e;const i=xr(t),s=Qs(t),l=Js(s),u=Xn(t),a=i==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[l]/2-o[l]/2;let h;switch(u){case"top":h={x:c,y:r.y-o.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(ao(t)){case"start":h[s]-=f*(n&&a?-1:1);break;case"end":h[s]+=f*(n&&a?-1:1);break}return h}const Zy=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let a=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Ru(a,r,u),f=r,h={},y=0;for(let _=0;_<l.length;_++){const{name:C,fn:w}=l[_],{x:v,y:E,data:S,reset:x}=await w({x:c,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:a,platform:s,elements:{reference:e,floating:t}});c=v??c,d=E??d,h={...h,[C]:{...h[C],...S}},x&&y<=50&&(y++,typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(a=x.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:c,y:d}=Ru(a,f,u)),_=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:h}};async function Vu(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:u}=e,{boundary:a="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=lo(t,e),y=$u(h),C=l[f?d==="floating"?"reference":"floating":d],w=Si(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(C)))==null||n?C:C.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:a,rootBoundary:c,strategy:u})),v=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),S=await(i.isElement==null?void 0:i.isElement(E))?await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1}:{x:1,y:1},x=Si(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:E,strategy:u}):v);return{top:(w.top-x.top+y.top)/S.y,bottom:(x.bottom-w.bottom+y.bottom)/S.y,left:(w.left-x.left+y.left)/S.x,right:(x.right-w.right+y.right)/S.x}}const qy=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:l,middlewareData:u}=t,{element:a,padding:c=0}=lo(e,t)||{};if(a==null)return{};const d=$u(c),f={x:n,y:r},h=Qs(o),y=Js(h),_=await s.getDimensions(a),C=h==="y",w=C?"top":"left",v=C?"bottom":"right",E=C?"clientHeight":"clientWidth",S=i.reference[y]+i.reference[h]-f[h]-i.floating[y],x=f[h]-i.reference[h],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a));let N=P?P[E]:0;(!N||!await(s.isElement==null?void 0:s.isElement(P)))&&(N=l.floating[E]||i.floating[y]);const O=S/2-x/2,T=N/2-_[y]/2-1,L=so(d[w],T),V=so(d[v],T),$=L,H=N-_[y]-V,k=N/2-_[y]/2+O,I=js($,k,H),b=!u.arrow&&ao(o)!=null&&k!==I&&i.reference[y]/2-(k<$?L:V)-_[y]/2<0,M=b?k<$?k-$:k-H:0;return{[h]:f[h]+M,data:{[h]:I,centerOffset:k-I-M,...b&&{alignmentOffset:M}},reset:b}}}),Gy=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:u,elements:a}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:_=!0,...C}=lo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=Xn(o),v=xr(l),E=Xn(l)===l,S=await(u.isRTL==null?void 0:u.isRTL(a.floating)),x=f||(E||!_?[Ei(l)]:Xy(l)),P=y!=="none";!f&&P&&x.push(...Ky(l,_,y,S));const N=[l,...x],O=await Vu(t,C),T=[];let L=((r=i.flip)==null?void 0:r.overflows)||[];if(c&&T.push(O[w]),d){const k=By(o,s,S);T.push(O[k[0]],O[k[1]])}if(L=[...L,{placement:o,overflows:T}],!T.every(k=>k<=0)){var V,$;const k=(((V=i.flip)==null?void 0:V.index)||0)+1,I=N[k];if(I)return{data:{index:k,overflows:L},reset:{placement:I}};let b=($=L.filter(M=>M.overflows[0]<=0).sort((M,A)=>M.overflows[1]-A.overflows[1])[0])==null?void 0:$.placement;if(!b)switch(h){case"bestFit":{var H;const M=(H=L.filter(A=>{if(P){const D=xr(A.placement);return D===v||D==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(D=>D>0).reduce((D,Y)=>D+Y,0)]).sort((A,D)=>A[1]-D[1])[0])==null?void 0:H[0];M&&(b=M);break}case"initialPlacement":b=l;break}if(o!==b)return{reset:{placement:b}}}return{}}}};async function Uy(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Xn(n),l=ao(n),u=xr(n)==="y",a=["left","top"].includes(s)?-1:1,c=i&&u?-1:1,d=lo(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof y=="number"&&(h=l==="end"?y*-1:y),u?{x:h*c,y:f*a}:{x:f*a,y:h*c}}const jy=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:l}=t,u=await Uy(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:s}}}}},Jy=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:C=>{let{x:w,y:v}=C;return{x:w,y:v}}},...u}=lo(e,t),a={x:n,y:r},c=await Vu(t,u),d=xr(Xn(o)),f=Hu(d);let h=a[f],y=a[d];if(i){const C=f==="y"?"top":"left",w=f==="y"?"bottom":"right",v=h+c[C],E=h-c[w];h=js(v,h,E)}if(s){const C=d==="y"?"top":"left",w=d==="y"?"bottom":"right",v=y+c[C],E=y-c[w];y=js(v,y,E)}const _=l.fn({...t,[f]:h,[d]:y});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[f]:i,[d]:s}}}}}};function Pi(){return typeof window<"u"}function Cr(e){return Yu(e)?(e.nodeName||"").toLowerCase():"#document"}function St(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function un(e){var t;return(t=(Yu(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yu(e){return Pi()?e instanceof Node||e instanceof St(e).Node:!1}function Vt(e){return Pi()?e instanceof Element||e instanceof St(e).Element:!1}function en(e){return Pi()?e instanceof HTMLElement||e instanceof St(e).HTMLElement:!1}function Bu(e){return!Pi()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof St(e).ShadowRoot}function co(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Yt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Qy(e){return["table","td","th"].includes(Cr(e))}function Mi(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function tl(e){const t=nl(),n=Vt(e)?Yt(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function em(e){let t=Mn(e);for(;en(t)&&!kr(t);){if(tl(t))return t;if(Mi(t))return null;t=Mn(t)}return null}function nl(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function kr(e){return["html","body","#document"].includes(Cr(e))}function Yt(e){return St(e).getComputedStyle(e)}function Ni(e){return Vt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mn(e){if(Cr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Bu(e)&&e.host||un(e);return Bu(t)?t.host:t}function Xu(e){const t=Mn(e);return kr(t)?e.ownerDocument?e.ownerDocument.body:e.body:en(t)&&co(t)?t:Xu(t)}function Wu(e,t,n){var r;t===void 0&&(t=[]);const o=Xu(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=St(o);return i?(rl(s),t.concat(s,s.visualViewport||[],co(o)?o:[],[])):t.concat(o,Wu(o,[]))}function rl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ku(e){const t=Yt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=en(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,l=ki(n)!==i||ki(r)!==s;return l&&(n=i,r=s),{width:n,height:r,$:l}}function Fu(e){return Vt(e)?e:e.contextElement}function Er(e){const t=Fu(e);if(!en(t))return Qt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ku(t);let s=(i?ki(n.width):n.width)/r,l=(i?ki(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const tm=Qt(0);function Zu(e){const t=St(e);return!nl()||!t.visualViewport?tm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nm(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==St(e)?!1:t}function uo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Fu(e);let s=Qt(1);t&&(r?Vt(r)&&(s=Er(r)):s=Er(e));const l=nm(i,n,r)?Zu(i):Qt(0);let u=(o.left+l.x)/s.x,a=(o.top+l.y)/s.y,c=o.width/s.x,d=o.height/s.y;if(i){const f=St(i),h=r&&Vt(r)?St(r):r;let y=f,_=rl(y);for(;_&&r&&h!==y;){const C=Er(_),w=_.getBoundingClientRect(),v=Yt(_),E=w.left+(_.clientLeft+parseFloat(v.paddingLeft))*C.x,S=w.top+(_.clientTop+parseFloat(v.paddingTop))*C.y;u*=C.x,a*=C.y,c*=C.x,d*=C.y,u+=E,a+=S,y=St(_),_=rl(y)}}return Si({width:c,height:d,x:u,y:a})}function ol(e,t){const n=Ni(e).scrollLeft;return t?t.left+n:uo(un(e)).left+n}function qu(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:ol(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function rm(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=un(r),l=t?Mi(t.floating):!1;if(r===s||l&&i)return n;let u={scrollLeft:0,scrollTop:0},a=Qt(1);const c=Qt(0),d=en(r);if((d||!d&&!i)&&((Cr(r)!=="body"||co(s))&&(u=Ni(r)),en(r))){const h=uo(r);a=Er(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const f=s&&!d&&!i?qu(s,u,!0):Qt(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-u.scrollLeft*a.x+c.x+f.x,y:n.y*a.y-u.scrollTop*a.y+c.y+f.y}}function om(e){return Array.from(e.getClientRects())}function im(e){const t=un(e),n=Ni(e),r=e.ownerDocument.body,o=br(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=br(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ol(e);const l=-n.scrollTop;return Yt(r).direction==="rtl"&&(s+=br(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}function sm(e,t){const n=St(e),r=un(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,u=0;if(o){i=o.width,s=o.height;const a=nl();(!a||a&&t==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}return{width:i,height:s,x:l,y:u}}function lm(e,t){const n=uo(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=en(e)?Er(e):Qt(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,u=o*i.x,a=r*i.y;return{width:s,height:l,x:u,y:a}}function Gu(e,t,n){let r;if(t==="viewport")r=sm(e,n);else if(t==="document")r=im(un(e));else if(Vt(t))r=lm(t,n);else{const o=Zu(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Si(r)}function Uu(e,t){const n=Mn(e);return n===t||!Vt(n)||kr(n)?!1:Yt(n).position==="fixed"||Uu(n,t)}function am(e,t){const n=t.get(e);if(n)return n;let r=Wu(e,[]).filter(l=>Vt(l)&&Cr(l)!=="body"),o=null;const i=Yt(e).position==="fixed";let s=i?Mn(e):e;for(;Vt(s)&&!kr(s);){const l=Yt(s),u=tl(s);!u&&l.position==="fixed"&&(o=null),(i?!u&&!o:!u&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||co(s)&&!u&&Uu(e,s))?r=r.filter(c=>c!==s):o=l,s=Mn(s)}return t.set(e,r),r}function cm(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Mi(t)?[]:am(t,this._c):[].concat(n),r],l=s[0],u=s.reduce((a,c)=>{const d=Gu(t,c,o);return a.top=br(d.top,a.top),a.right=so(d.right,a.right),a.bottom=so(d.bottom,a.bottom),a.left=br(d.left,a.left),a},Gu(t,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function um(e){const{width:t,height:n}=Ku(e);return{width:t,height:n}}function dm(e,t,n){const r=en(t),o=un(t),i=n==="fixed",s=uo(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const u=Qt(0);if(r||!r&&!i)if((Cr(t)!=="body"||co(o))&&(l=Ni(t)),r){const f=uo(t,!0,i,t);u.x=f.x+t.clientLeft,u.y=f.y+t.clientTop}else o&&(u.x=ol(o));const a=o&&!r&&!i?qu(o,l):Qt(0),c=s.left+l.scrollLeft-u.x-a.x,d=s.top+l.scrollTop-u.y-a.y;return{x:c,y:d,width:s.width,height:s.height}}function il(e){return Yt(e).position==="static"}function ju(e,t){if(!en(e)||Yt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return un(e)===n&&(n=n.ownerDocument.body),n}function Ju(e,t){const n=St(e);if(Mi(e))return n;if(!en(e)){let o=Mn(e);for(;o&&!kr(o);){if(Vt(o)&&!il(o))return o;o=Mn(o)}return n}let r=ju(e,t);for(;r&&Qy(r)&&il(r);)r=ju(r,t);return r&&kr(r)&&il(r)&&!tl(r)?n:r||em(e)||n}const fm=async function(e){const t=this.getOffsetParent||Ju,n=this.getDimensions,r=await n(e.floating);return{reference:dm(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hm(e){return Yt(e).direction==="rtl"}const gm={convertOffsetParentRelativeRectToViewportRelativeRect:rm,getDocumentElement:un,getClippingRect:cm,getOffsetParent:Ju,getElementRects:fm,getClientRects:om,getDimensions:um,getScale:Er,isElement:Vt,isRTL:hm},vm=jy,ym=Jy,mm=Gy,pm=qy,wm=(e,t,n)=>{const r=new Map,o={platform:gm,...n},i={...o.platform,_c:r};return Zy(e,t,{...o,platform:i})},_m=({trigger:e,triggerEvent:t,floatContent:n,placement:r,offsetOptions:o,flipOptions:i,shiftOptions:s,interactive:l,showArrow:u})=>{if(typeof e=="string"){const w=document.querySelector(e);if(w)e=w;else throw new Error("element not found by document.querySelector('"+e+"')")}let a;if(typeof n=="string"){const w=document.querySelector(n);if(w)a=w;else throw new Error("element not found by document.querySelector('"+n+"')")}else a=n;r||(r="bottom");let c;u&&(c=document.createElement("div"),c.style.position="absolute",c.style.backgroundColor="#222",c.style.width="8px",c.style.height="8px",c.style.transform="rotate(45deg)",c.style.display="none",a.firstElementChild.before(c));function d(){wm(e,a,{placement:r,middleware:[vm(o),mm(i),ym(s),...u?[pm({element:c})]:[]]}).then(({x:w,y:v,placement:E,middlewareData:S})=>{if(Object.assign(a.style,{left:`${w}px`,top:`${v}px`}),u){const{x,y:P}=S.arrow,N={top:"bottom",right:"left",bottom:"top",left:"right"}[E.split("-")[0]];Object.assign(c.style,{zIndex:-1,left:x!=null?`${x}px`:"",top:P!=null?`${P}px`:"",right:"",bottom:"",[N]:"2px"})}})}let f=!1;function h(){a.style.display="block",a.style.visibility="block",a.style.position="absolute",u&&(c.style.display="block"),f=!0,d()}function y(){a.style.display="none",u&&(c.style.display="none"),f=!1}function _(w){w.stopPropagation(),f?y():h()}function C(w){a.contains(w.target)||y()}return(!t||t.length==0)&&(l?t=["click"]:t=["mouseenter","focus"]),t.forEach(w=>{e.addEventListener(w,_)}),l?document.addEventListener("click",C):["mouseleave","blur"].forEach(w=>{e.addEventListener(w,y)}),{destroy(){l&&document.removeEventListener("click",C)},hide(){y()},isVisible(){return f}}};var bm=ve('<div style="position: relative"><div><!></div> <div style="display: none;width: 100%;z-index: 9999"><!></div></div>');function Qu(e,t){ue(t,!0);const n=p(t,"children",7),r=p(t,"floating",7);let o,i,s;sr(()=>(s=_m({trigger:o,floatContent:i,interactive:!0,placement:"bottom-start"}),()=>{s.destroy()}));function l(){s.hide()}var u=bm(),a=ge(u),c=ge(a);Do(c,n),ae(a),ir(a,h=>o=h,()=>o);var d=ye(a,2),f=ge(d);return Do(f,r),ae(d),ir(d,h=>i=h,()=>i),ae(u),K(e,u),de({hide:l,get children(){return n()},set children(h){n(h),m()},get floating(){return r()},set floating(h){r(h),m()}})}se(Qu,{children:{},floating:{}},[],["hide"],!0);const xm=e=>{var t=Cm(),n=ye(ge(t),2),r=ge(n);xi(r,{value:"bbb",style:"width: 45%"});var o=ye(r,2);xi(o,{disabled:!0,value:"string",style:"width: 45%"});var i=ye(o,2),s=ge(i);zu(s,{}),ae(i),ae(n),ae(t),K(e,t)};var Cm=ve('<div class="tf-node-content svelte-1w0cio8"><div class="tf-node-content-header svelte-1w0cio8"><span style="width: 45%">变量名</span> <span style="width: 45%">变量类型</span> <span style="width: 10%">必填</span></div> <div class="tf-node-content-panel svelte-1w0cio8"><!> <!> <div style="width: 10%"><!></div></div></div>'),km=ve("<!> <!> <!> <!>",1);const Em={hash:"svelte-1w0cio8",code:".tf-node-content.svelte-1w0cio8 {display:flex;flex-direction:column;gap:5px;padding-top:20px}.tf-node-content-header.svelte-1w0cio8 {display:flex;gap:5px;font-size:12px;color:#aaa;justify-content:space-around;}.tf-node-content-panel.svelte-1w0cio8 {display:flex;gap:5px;font-size:12px;color:#aaa;justify-content:space-around;align-items:center;}"};function ed(e,t){ue(t,!0),qt(e,Em),Us(us(t,["$$slots","$$events","$$legacy","$$host"]));const r=[{key:"input",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 14C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14ZM12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12C16 14.2091 14.2091 16 12 16Z"></path></svg>',title:"开始节点",description:"调用大模型处理任务或回答问题",content:xm}];_i(e,{children:(o,i)=>{var s=km(),l=$e(s);Ci(l,{items:r});var u=ye(l,2);Iu(u,{items:[{value:"aaa",label:"aaa"},{value:"bbb",label:"bbb"},{value:"ccc",label:"ccc"}],style:"width: 100%"});var a=ye(u,2);xi(a,{value:"bbb",style:"width: 100%;"});var c=ye(a,2);Du(c,{rows:10,style:"width: 100%;"}),K(o,s)},$$slots:{default:!0}}),de()}se(ed,{},[],[],!0);const Sm=e=>{var t=Pm();K(e,t)};var Pm=ve('<div style="display: flex;flex-direction: column;gap: 5px;padding-top: 20px"><div style="display: flex;gap: 5px;font-size: 12px;color: #aaa"><span>变量名</span> <span>变量类型</span> <span>必填</span></div></div>');function td(e,t){ue(t,!0),Us(us(t,["$$slots","$$events","$$legacy","$$host"]));const r=[{key:"input",title:"结束节点",description:"调用大模型处理任务或回答问题",content:Sm}];_i(e,{children:(o,i)=>{Ci(o,{items:r})},$$slots:{default:!0}}),de()}se(td,{},[],[],!0);const Mm=e=>{var t=Nm();K(e,t)};var Nm=ve('<div style="display: flex;flex-direction: column;gap: 5px;padding-top: 20px"><div style="display: flex;gap: 5px;font-size: 12px;color: #aaa"><span>变量名</span> <span>变量类型</span> <span>必填</span></div></div>');function nd(e,t){ue(t,!0),Us(us(t,["$$slots","$$events","$$legacy","$$host"]));const r=[{key:"input",title:"大模型",description:"调用大模型处理任务或回答问题",content:Mm}];_i(e,{children:(o,i)=>{Ci(o,{items:r})},$$slots:{default:!0}}),de()}se(nd,{},[],[],!0);const Om={startNode:ed,llmNode:nd,endNode:td};var Tm=ve("<!> ",1);function rd(e,t){ue(t,!0);const n=p(t,"icon",7),r=p(t,"label",7),o=p(t,"node",7);return bi(e,{draggable:!0,ondragstart:s=>{if(!s.dataTransfer)return null;const l=o()?JSON.stringify(o()):"";s.dataTransfer.setData("application/tinyflow",l),s.dataTransfer.effectAllowed="move"},children:(s,l)=>{var u=Tm(),a=$e(u);Ql(a,n);var c=ye(a);pe(()=>bn(c,` ${r()??""}`)),K(s,u)},$$slots:{default:!0}}),de({get icon(){return n()},set icon(s){n(s),m()},get label(){return r()},set label(s){r(s),m()},get node(){return o()},set node(s){o(s),m()}})}se(rd,{icon:{},label:{},node:{}},[],[],!0);var Am=je('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z"></path></svg>'),zm=je('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z"></path></svg>'),Dm=ve('<div><div class="tf-toolbar-container "><div class="tf-toolbar-container-header"><!></div> <div class="tf-toolbar-container-body"><div class="tf-toolbar-container-base"></div> <div class="tf-toolbar-container-tools"><!></div></div></div> <!></div>');function od(e){let t=ml("base"),n=ml("show");const r=[{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12C15 13.6569 13.6569 15 12 15Z"></path></svg>',label:"开始节点",value:"startNode"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5.46257 4.43262C7.21556 2.91688 9.5007 2 12 2C17.5228 2 22 6.47715 22 12C22 14.1361 21.3302 16.1158 20.1892 17.7406L17 12H20C20 7.58172 16.4183 4 12 4C9.84982 4 7.89777 4.84827 6.46023 6.22842L5.46257 4.43262ZM18.5374 19.5674C16.7844 21.0831 14.4993 22 12 22C6.47715 22 2 17.5228 2 12C2 9.86386 2.66979 7.88416 3.8108 6.25944L7 12H4C4 16.4183 7.58172 20 12 20C14.1502 20 16.1022 19.1517 17.5398 17.7716L18.5374 19.5674Z"></path></svg>',label:"循环",value:"startNode"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20.7134 7.12811L20.4668 7.69379C20.2864 8.10792 19.7136 8.10792 19.5331 7.69379L19.2866 7.12811C18.8471 6.11947 18.0555 5.31641 17.0677 4.87708L16.308 4.53922C15.8973 4.35653 15.8973 3.75881 16.308 3.57612L17.0252 3.25714C18.0384 2.80651 18.8442 1.97373 19.2761 0.930828L19.5293 0.319534C19.7058 -0.106511 20.2942 -0.106511 20.4706 0.319534L20.7238 0.930828C21.1558 1.97373 21.9616 2.80651 22.9748 3.25714L23.6919 3.57612C24.1027 3.75881 24.1027 4.35653 23.6919 4.53922L22.9323 4.87708C21.9445 5.31641 21.1529 6.11947 20.7134 7.12811ZM9 2C13.0675 2 16.426 5.03562 16.9337 8.96494L19.1842 12.5037C19.3324 12.7367 19.3025 13.0847 18.9593 13.2317L17 14.071V17C17 18.1046 16.1046 19 15 19H13.001L13 22H4L4.00025 18.3061C4.00033 17.1252 3.56351 16.0087 2.7555 15.0011C1.65707 13.6313 1 11.8924 1 10C1 5.58172 4.58172 2 9 2ZM9 4C5.68629 4 3 6.68629 3 10C3 11.3849 3.46818 12.6929 4.31578 13.7499C5.40965 15.114 6.00036 16.6672 6.00025 18.3063L6.00013 20H11.0007L11.0017 17H15V12.7519L16.5497 12.0881L15.0072 9.66262L14.9501 9.22118C14.5665 6.25141 12.0243 4 9 4ZM19.4893 16.9929L21.1535 18.1024C22.32 16.3562 23 14.2576 23 12.0001C23 11.317 22.9378 10.6486 22.8186 10L20.8756 10.5C20.9574 10.9878 21 11.489 21 12.0001C21 13.8471 20.4436 15.5642 19.4893 16.9929Z"></path></svg>',label:"大模型",value:"startNode"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M15.5 5C13.567 5 12 6.567 12 8.5C12 10.433 13.567 12 15.5 12C17.433 12 19 10.433 19 8.5C19 6.567 17.433 5 15.5 5ZM10 8.5C10 5.46243 12.4624 3 15.5 3C18.5376 3 21 5.46243 21 8.5C21 9.6575 20.6424 10.7315 20.0317 11.6175L22.7071 14.2929L21.2929 15.7071L18.6175 13.0317C17.7315 13.6424 16.6575 14 15.5 14C12.4624 14 10 11.5376 10 8.5ZM3 4H8V6H3V4ZM3 11H8V13H3V11ZM21 18V20H3V18H21Z"></path></svg>',label:"知识库",value:"startNode"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"></path></svg>',label:"搜索引擎",value:"startNode"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M6.23509 6.45329C4.85101 7.89148 4 9.84636 4 12C4 16.4183 7.58172 20 12 20C13.0808 20 14.1116 19.7857 15.0521 19.3972C15.1671 18.6467 14.9148 17.9266 14.8116 17.6746C14.582 17.115 13.8241 16.1582 12.5589 14.8308C12.2212 14.4758 12.2429 14.2035 12.3636 13.3943L12.3775 13.3029C12.4595 12.7486 12.5971 12.4209 14.4622 12.1248C15.4097 11.9746 15.6589 12.3533 16.0043 12.8777C16.0425 12.9358 16.0807 12.9928 16.1198 13.0499C16.4479 13.5297 16.691 13.6394 17.0582 13.8064C17.2227 13.881 17.428 13.9751 17.7031 14.1314C18.3551 14.504 18.3551 14.9247 18.3551 15.8472V15.9518C18.3551 16.3434 18.3168 16.6872 18.2566 16.9859C19.3478 15.6185 20 13.8854 20 12C20 8.70089 18.003 5.8682 15.1519 4.64482C14.5987 5.01813 13.8398 5.54726 13.575 5.91C13.4396 6.09538 13.2482 7.04166 12.6257 7.11976C12.4626 7.14023 12.2438 7.12589 12.012 7.11097C11.3905 7.07058 10.5402 7.01606 10.268 7.75495C10.0952 8.2232 10.0648 9.49445 10.6239 10.1543C10.7134 10.2597 10.7307 10.4547 10.6699 10.6735C10.59 10.9608 10.4286 11.1356 10.3783 11.1717C10.2819 11.1163 10.0896 10.8931 9.95938 10.7412C9.64554 10.3765 9.25405 9.92233 8.74797 9.78176C8.56395 9.73083 8.36166 9.68867 8.16548 9.64736C7.6164 9.53227 6.99443 9.40134 6.84992 9.09302C6.74442 8.8672 6.74488 8.55621 6.74529 8.22764C6.74529 7.8112 6.74529 7.34029 6.54129 6.88256C6.46246 6.70541 6.35689 6.56446 6.23509 6.45329ZM12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22Z"></path></svg>',label:"Http 请求",value:"startNode"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M23 12L15.9289 19.0711L14.5147 17.6569L20.1716 12L14.5147 6.34317L15.9289 4.92896L23 12ZM3.82843 12L9.48528 17.6569L8.07107 19.0711L1 12L8.07107 4.92896L9.48528 6.34317L3.82843 12Z"></path></svg>',label:"动态代码",value:"startNode"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 4C2 3.44772 2.44772 3 3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4ZM4 5V19H20V5H4ZM7 8H17V11H15V10H13V14H14.5V16H9.5V14H11V10H9V11H7V8Z"></path></svg>',label:"内容模板",value:"startNode"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M6 5.1438V16.0002H18.3391L6 5.1438ZM4 2.932C4 2.07155 5.01456 1.61285 5.66056 2.18123L21.6501 16.2494C22.3423 16.8584 21.9116 18.0002 20.9896 18.0002H6V22H4V2.932Z"></path></svg>',label:"结束节点",value:"endNode"}],o=[{label:"基础节点",value:"base"},{label:"业务工具",value:"tools"}];var i=Dm(),s=ge(i),l=ge(s),u=ge(l);Lu(u,{style:"width: 100%",items:o,onChange:y=>{X(t,yn(y.value.toString()))}}),ae(l);var a=ye(l,2),c=ge(a);xn(c,21,()=>r,zo,(y,_)=>{rd(y,{get icon(){return g(_).icon},get label(){return g(_).label}})}),ae(c);var d=ye(c,2),f=ge(d);bi(f,{children:(y,_)=>{zr();var C=Yr("一个按钮22");K(y,C)},$$slots:{default:!0}}),ae(d),ae(a),ae(s);var h=ye(s,2);bi(h,{onclick:()=>{X(n,yn(g(n)?"":"show"))},children:(y,_)=>{var C=at(),w=$e(C);{var v=S=>{var x=Am();K(S,x)},E=S=>{var x=zm();K(S,x)};We(w,S=>{g(n)==="show"?S(v):S(E,!1)})}K(y,C)},$$slots:{default:!0}}),ae(i),pe(()=>{or(i,`tf-toolbar ${g(n)??""}`),ee(c,"style",`display: ${(g(t)==="base"?"flex":"none")??""}`),ee(d,"style",`display: ${(g(t)!=="base"?"flex":"none")??""}`)}),K(e,i)}se(od,{},[],[],!0);var Lm=ve("<!> <!> <!>",1),Im=ve('<div style="position: relative;height: 100%;width: 100%"><!> <!></div>');function id(e,t){ue(t,!0);const n=p(t,"onInit",7),r=my();n()(r);function o(c){console.log("onNodeDragStart: ",c)}const i=c=>{c.preventDefault(),c.dataTransfer&&(c.dataTransfer.dropEffect="move")},s=c=>{c.preventDefault();const d=r.screenToFlowPosition({x:c.clientX-250,y:c.clientY-100}),f={id:`${Math.random()}`,type:"startNode",position:d,data:{label:"startNode node"},origin:[.5,0]};wi.addNode(f),wi.selectNodeOnly(f.id)};var l=Im(),u=ge(l);od(u);var a=ye(u,2);return pu(a,In({nodeTypes:Om},wi,{class:"tinyflow-logo",$$events:{nodedragstart:o,drop:s,dragover:i},children:(c,d)=>{var f=Lm(),h=$e(f);Mu(h,{});var y=ye(h,2);Eu(y,{});var _=ye(y,2);Ou(_,{}),K(c,f)},$$slots:{default:!0}})),ae(l),K(e,l),de({get onInit(){return n()},set onInit(c){n(c),m()}})}se(id,{onInit:{}},[],[],!0);function Hm(e,t){ue(t,!0);const n=p(t,"data",7),r=p(t,"onInit",7);return wi.init(n().nodes,n().edges),wu(e,{fitView:!0,children:(o,i)=>{id(o,{get onInit(){return r()}})},$$slots:{default:!0}}),de({get data(){return n()},set data(o){n(o),m()},get onInit(){return r()},set onInit(o){r(o),m()}})}customElements.define("tinyflow-component",se(Hm,{data:{},onInit:{}},[],[],!1)),Le.Tinyflow=wy,Object.defineProperty(Le,Symbol.toStringTag,{value:"Module"})});
